From: Andreas Platschek <platschek@ict.tuwien.ac.at>
To: kernel-janitors@vger.kernel.org
Subject: [PATCH] Staging: rtl8192e prohibit deferencing of NULL pointer
Date: Wed, 18 Jun 2014 18:16:09 +0000 [thread overview]
Message-ID: <53A1D769.7090301@ict.tuwien.ac.at> (raw)
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@ict.tuwien.ac.at>
---
drivers/staging/rtl8192e/rtllib_rx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c
b/drivers/staging/rtl8192e/rtllib_rx.c
index 60de54c..badf6e2 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -1496,7 +1496,9 @@ 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
next reply other threads:[~2014-06-18 18:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 18:16 Andreas Platschek [this message]
2014-06-18 18:33 ` [PATCH] Staging: rtl8192e prohibit deferencing of NULL pointer Valentina Manea
2014-06-18 18:48 ` Dan Carpenter
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=53A1D769.7090301@ict.tuwien.ac.at \
--to=platschek@ict.tuwien.ac.at \
--cc=kernel-janitors@vger.kernel.org \
/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