Skip to contentSkip to conversation

tipc: fix a double kfree_skb()

PATCH In review Cong Wang 3 participants 3 messages Dec 10, 2018 – Dec 14, 2018

Subsystems (3)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 tipc: fix a double kfree_skb()

tipc_udp_xmit() drops the packet on error, there is no need to drop it again.

Fixes ef20cd4dd163 ("tipc: introduce UDP replicast")
Reported-and-tested-by [email protected]
Cc Ying Xue <[email protected]>
Cc Jon Maloy <[email protected]>
---
 net/tipc/udp_media.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/tipc/udp_media.c +1 -3
index 10dc59ce9c82..1b1ba1310ea7 100644
@@ -245,10 +245,8 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb,
 		}
 
 		err = tipc_udp_xmit(net, _skb, ub, src, &rcast->addr);
-		if (err) {
-			kfree_skb(_skb);
+		if (err)
 			goto out;
-		}
 	}
 	err = 0;
 out:
Signature · 1 line
2.19.2
#1 lore raw

Acked.
Thank you for both your quick fixes, Cong.

///jon

Quoted 39 lines

-----Original Message-----
From: Cong Wang <[email protected]>
Sent: 10-Dec-18 15:46
To: [email protected]
Cc: Cong Wang <[email protected]>; Ying Xue <[email protected]>; Jon Maloy <[email protected]>
Subject: [Patch net] tipc: fix a double kfree_skb()

tipc_udp_xmit() drops the packet on error, there is no need to drop it again.

Fixes ef20cd4dd163 ("tipc: introduce UDP replicast")

Reported-and-tested-by:
[email protected]

---
 net/tipc/udp_media.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/tipc/udp_media.c index renamed from net/tipc/udp_media.c +0 -0

10dc59ce9c82..1b1ba1310ea7 100644

net/tipc/udp_media.c +1 -3
@@ -245,10 +245,8 @@ static int tipc_udp_send_msg(struct net *net, struct
 sk_buff *skb,
 		}
 
 		err = tipc_udp_xmit(net, _skb, ub, src, &rcast->addr);
-		if (err) {
-			kfree_skb(_skb);
+		if (err)
 			goto out;
-		}
 	}
 	err = 0;

out:
--
2.19.2