Staging: rtl8192e: Fix potential NULL pointer dereference
authorEmil Goode <emilgoode@gmail.com>
Wed, 2 Jul 2014 09:25:51 +0000 (11:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 18:49:15 +0000 (11:49 -0700)
We need to make sure the struct rtllib_device pointer ieee is not NULL
after the goto rx_dropped label since it is dereferenced there.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtllib_rx.c

index 60de54cc601f4a180a8764f1769c4c9769d1299e..7db3e7445428a528f805dfd079eb0362286731cf 100644 (file)
@@ -1496,7 +1496,8 @@ int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb,
        return ret;
 
  rx_dropped:
-       ieee->stats.rx_dropped++;
+       if (ieee)
+               ieee->stats.rx_dropped++;
        return 0;
 }
 EXPORT_SYMBOL(rtllib_rx);