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:
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++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue