From: Emil Goode <emilgoode@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rashika Kheria <rashika.kheria@gmail.com>,
Valentina Manea <valentina.manea.m@gmail.com>,
Josh Triplett <josh@joshtriplett.org>,
Andrea Merello <andrea.merello@gmail.com>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org, Emil Goode <emilgoode@gmail.com>
Subject: [PATCH] Staging: rtl8192e: Fix potential NULL pointer dereference
Date: Wed, 2 Jul 2014 11:25:51 +0200 [thread overview]
Message-ID: <1404293151-15804-1-git-send-email-emilgoode@gmail.com> (raw)
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>
---
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..7db3e74 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);
--
1.7.10.4
next reply other threads:[~2014-07-02 9:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-02 9:25 Emil Goode [this message]
2014-07-02 16:33 ` [PATCH] Staging: rtl8192e: Fix potential NULL pointer dereference Greg Kroah-Hartman
2014-07-02 17:26 ` Emil Goode
2014-07-02 17:32 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1404293151-15804-1-git-send-email-emilgoode@gmail.com \
--to=emilgoode@gmail.com \
--cc=andrea.merello@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=josh@joshtriplett.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rashika.kheria@gmail.com \
--cc=valentina.manea.m@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox