mctp: i2c: fix skb memory leak in receive path
PATCH 1/1 mctp: i2c: fix skb memory leak in receive path
When 'midev->allow_rx' is false, the newly allocated skb isn't consumed by netif_rx(), it needs to free the skb directly.
Fixes f5b8abf9fc3d ("mctp i2c: MCTP I2C binding driver")
Signed-off-by Haiyue Wang <[email protected]>
--- drivers/net/mctp/mctp-i2c.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/mctp/mctp-i2c.c +1 -0
@@ -343,6 +343,7 @@ static int mctp_i2c_recv(struct mctp_i2c_dev *midev) }else { status =NET_RX_DROP ;spin_unlock_irqrestore (&midev->lock, flags); +kfree_skb (skb); }if (status ==NET_RX_SUCCESS ) {
Signature · 1 line
2.53.0
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:
Quoted 8 lines · On Thu, 5 Mar 2026 22:32:34 +0800 you wrote:
When '
midev->allow_rx' is false, the newly allocated skb isn't consumed bynetif_rx(), it needs to free the skb directly.Fixes f5b8abf9fc3d ("mctp i2c: MCTP I2C binding driver")Signed-off-by Haiyue Wang <[email protected]>--- drivers/net/mctp/mctp-i2c.c | 1 + 1 file changed, 1 insertion(+)
Here is the summary with links:
- [net,v1] mctp: i2c: fix skb memory leak in receive path
https://git.kernel.org/netdev/net/c/e3f5e0f22cfc
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html