staging: gdm724x: fix use after free in gdm_lte_rx()

The netif_rx_ni() function frees the skb so we can't dereference it to
save the skb->len.

Fixes: 61e1210476 ("staging: gdm7240: adding LTE USB driver")
Cc: stable <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/20220228074331.GA13685@kili
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Dan Carpenter authored and Greg Kroah-Hartman committed 2022-03-01 22:42:32 +01:00
1 parent 7e57714cd0
commit fc7f750dc9
1 file changed
+3 -2
+3 -2
View File
@@ -76,14 +76,15 @@ static void tx_complete(void *arg)
static int gdm_lte_rx(struct sk_buff *skb, struct nic *nic, int nic_type)
{
int ret;
int ret, len;
len = skb->len + ETH_HLEN;
ret = netif_rx_ni(skb);
if (ret == NET_RX_DROP) {
nic->stats.rx_dropped++;
} else {
nic->stats.rx_packets++;
nic->stats.rx_bytes += skb->len + ETH_HLEN;
nic->stats.rx_bytes += len;
}
return 0;