summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2016-09-07 17:23:09 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-12 11:18:15 +0200
commit8defffb20854500825162d336bdd183d2d218cf9 (patch)
tree131bd2259608db5a35aa6de9f2e634f5e803445c
parentf5dc9399c07ee141924bcdccfeeacd7597a44cfe (diff)
downloadlinux-8defffb20854500825162d336bdd183d2d218cf9.tar.bz2
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: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/ks7010/ks_wlan_net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 1e21eb1c4667..d69b4c945d21 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -3396,13 +3396,13 @@ void send_packet_complete(void *arg1, void *arg2)
DPRINTK(3, "\n");
- priv->nstats.tx_bytes += packet->len;
priv->nstats.tx_packets++;
if (netif_queue_stopped(priv->net_dev))
netif_wake_queue(priv->net_dev);
if (packet) {
+ priv->nstats.tx_bytes += packet->len;
dev_kfree_skb(packet);
packet = NULL;
}