mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 02:02:28 +09:00
mctp i2c: Fix potential use-after-free
The skb is handed off to netif_rx() which may free it. Found by Smatch. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Matt Johnston <matt@codeconstruct.com.au> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
f62457df5c
commit
06bf1ce69d
@@ -338,7 +338,7 @@ static int mctp_i2c_recv(struct mctp_i2c_dev *midev)
|
||||
|
||||
if (status == NET_RX_SUCCESS) {
|
||||
ndev->stats.rx_packets++;
|
||||
ndev->stats.rx_bytes += skb->len;
|
||||
ndev->stats.rx_bytes += recvlen;
|
||||
} else {
|
||||
ndev->stats.rx_dropped++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user