From 4fa426021426bb1846b3e86dee74517e481e089f Mon Sep 17 00:00:00 2001 From: Emil Goode Date: Wed, 2 Jul 2014 11:25:51 +0200 Subject: [PATCH] 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 Signed-off-by: Greg Kroah-Hartman --- 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 60de54cc601f..7db3e7445428 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) + ieee->stats.rx_dropped++; return 0; } EXPORT_SYMBOL(rtllib_rx); -- 2.30.2