2021-11-30 03:04:25

by Yang Yingliang

[permalink] [raw]
Subject: [PATCH -next] mctp: test: use kfree_skb() instead of kfree()

Use kfree_skb() instead of kfree() to free sk_buff.

Signed-off-by: Yang Yingliang <[email protected]>
---
net/mctp/test/utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mctp/test/utils.c b/net/mctp/test/utils.c
index cc6b8803aa9d..7b7918702592 100644
--- a/net/mctp/test/utils.c
+++ b/net/mctp/test/utils.c
@@ -12,7 +12,7 @@
static netdev_tx_t mctp_test_dev_tx(struct sk_buff *skb,
struct net_device *ndev)
{
- kfree(skb);
+ kfree_skb(skb);
return NETDEV_TX_OK;
}

--
2.25.1



2021-11-30 03:27:41

by Jeremy Kerr

[permalink] [raw]
Subject: Re: [PATCH -next] mctp: test: use kfree_skb() instead of kfree()

Hi Yang,

> Use kfree_skb() instead of kfree() to free sk_buff.

Thanks for the patch! We do already have this queued in -net though:

https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=d85195654470

(which should percolate to net-next in due course too).

Cheers,


Jeremy