[PATCH v2] Staging: rtl8192e prohibit deferencing of NULL pointer

Andreas Platschek platschek at ict.tuwien.ac.at
Wed Jun 18 18:50:50 UTC 2014


v2: removed braces from if statement

If ieee == NULL we jump to rx_dropped. Therefore we have to check again,
if ieee == NULL before we use it.

Signed-off-by: Andreas Platschek <platschek at ict.tuwien.ac.at>
---
 drivers/staging/rtl8192e/rtllib_rx.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c
b/drivers/staging/rtl8192e/rtllib_rx.c
index 60de54c..7258b17 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -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 != NULL)
+               ieee->stats.rx_dropped++;
        return 0;
 }
 EXPORT_SYMBOL(rtllib_rx);
-- 
1.7.10.4


More information about the devel mailing list