Skip to content

Commit e3f5e0f

Browse files
haiyuewaPaolo Abeni
authored andcommitted
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: f5b8abf ("mctp i2c: MCTP I2C binding driver") Signed-off-by: Haiyue Wang <haiyuewa@163.com> Link: https://patch.msgid.link/20260305143240.97592-1-haiyuewa@163.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent fdfd103 commit e3f5e0f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/net/mctp/mctp-i2c.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ static int mctp_i2c_recv(struct mctp_i2c_dev *midev)
343343
} else {
344344
status = NET_RX_DROP;
345345
spin_unlock_irqrestore(&midev->lock, flags);
346+
kfree_skb(skb);
346347
}
347348

348349
if (status == NET_RX_SUCCESS) {

0 commit comments

Comments
 (0)