Commit 8defffb2 authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman

staging: ks7010: avoid dereferencing packet if it is null

Updating tx_bytes from packet->len if packet is null will cause
a null pointer dereference, so only update tx_bytes if it packet
is not null.
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f5dc9399
...@@ -3396,13 +3396,13 @@ void send_packet_complete(void *arg1, void *arg2) ...@@ -3396,13 +3396,13 @@ void send_packet_complete(void *arg1, void *arg2)
DPRINTK(3, "\n"); DPRINTK(3, "\n");
priv->nstats.tx_bytes += packet->len;
priv->nstats.tx_packets++; priv->nstats.tx_packets++;
if (netif_queue_stopped(priv->net_dev)) if (netif_queue_stopped(priv->net_dev))
netif_wake_queue(priv->net_dev); netif_wake_queue(priv->net_dev);
if (packet) { if (packet) {
priv->nstats.tx_bytes += packet->len;
dev_kfree_skb(packet); dev_kfree_skb(packet);
packet = NULL; packet = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment