Skip to contentSkip to conversation

net: dsa: sja1105: Fix missing unlock on error in sk_buff()

PATCH Applied Wei Yongjun 5 participants 5 messages Jul 17, 2019 – Jul 18, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: sja1105: Fix missing unlock on error in sk_buff()

Add the missing unlock before return from function sk_buff() in the error handling case.

Fixes f3097be21bf1 ("net: dsa: sja1105: Add a state machine for RX timestamping")
---
 net/dsa/tag_sja1105.c | 1 +
 1 file changed, 1 insertion(+)
net/dsa/tag_sja1105.c +1 -0
index 1d96c9d4a8e9..26363d72d25b 100644
@@ -216,6 +216,7 @@ static struct sk_buff
 		if (!skb) {
 			dev_err_ratelimited(dp->ds->dev,
 					    "Failed to copy stampable skb\n");
+			spin_unlock(&sp->data->meta_lock);
 			return NULL;
 		}
 		sja1105_transfer_meta(skb, meta);
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Wei Yongjun

Add the missing unlock before return from function sk_buff() in the error handling case.

Fixes f3097be21bf1 ("net: dsa: sja1105: Add a state machine for RX timestamping")

---

Quoted 18 lines
 net/dsa/tag_sja1105.c | 1 +
 1 file changed, 1 insertion(+)
net/dsa/tag_sja1105.c +1 -0
index 1d96c9d4a8e9..26363d72d25b 100644
@@ -216,6 +216,7 @@ static struct sk_buff
                if (!skb) {
                        dev_err_ratelimited(dp->ds->dev,
                                            "Failed to copy stampable skb\n");
+                       spin_unlock(&sp->data->meta_lock);
                        return NULL;
                }
                sja1105_transfer_meta(skb, meta);