Browse Source

Staging: rtl8192e: Fix potential NULL pointer dereference

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>
Emil Goode 11 years ago
parent
commit
4fa4260214
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/staging/rtl8192e/rtllib_rx.c

+ 2 - 1
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)
+		ieee->stats.rx_dropped++;
 	return 0;
 }
 EXPORT_SYMBOL(rtllib_rx);