Thread (3 messages) flat view 3 messages, 3 authors, 2016-08-10

Re: [PATCH] drivers: net: cpsw: fix kmemleak false-positive reports for sk buffers

From: Catalin Marinas <catalin.marinas@arm.com>
Date: 2016-08-09 15:19:45
Also in: linux-omap, lkml

On Tue, Aug 09, 2016 at 03:09:44PM +0300, Grygorii Strashko wrote:
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 0805855..0456e0e 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -732,6 +732,7 @@ static void cpsw_rx_handler(void *token, int len, int status)
 		netif_receive_skb(skb);
 		ndev->stats.rx_bytes += len;
 		ndev->stats.rx_packets++;
+		kmemleak_not_leak(new_skb);
 	} else {
 		ndev->stats.rx_dropped++;
 		new_skb = skb;
@@ -1323,6 +1324,7 @@ static int cpsw_ndo_open(struct net_device *ndev)
 				kfree_skb(skb);
 				goto err_cleanup;
 			}
+			kmemleak_not_leak(skb);
Nitpick: I would add a short comment above the kmemleak_not_leak() calls
on why there is a false positive. Otherwise:

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help