From: Chandra S Gorentla <csgorentla@gmail.com>
To: gregkh@linuxfoundation.org
Cc: johnny.kim@atmel.com, rachel.kim@atmel.com, dean.lee@atmel.com,
chris.park@atmel.com, linux-wireless@vger.kernel.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Chandra S Gorentla <csgorentla@gmail.com>
Subject: [PATCH] drivers: stating: wilc1000: Add a check for SPI availability
Date: Mon, 14 Sep 2015 22:21:14 +0530 [thread overview]
Message-ID: <1442249474-3014-1-git-send-email-csgorentla@gmail.com> (raw)
NULL pointer deference is observed in the wilc1000.ko module
with bus type SPI and when SPI is not ready.
Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com>
---
Following are the steps to reproduce.
$ sudo insmod drivers/staging/wilc1000/wilc1000.ko
$ sudo ifconfig wlan1 up
wlan1 in the above command is the device controlled by 'wilc1000.ko'.
drivers/staging/wilc1000/linux_wlan.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 63f44f8..48f063d 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1634,6 +1634,12 @@ int mac_open(struct net_device *ndev)
int i = 0;
struct WILC_WFI_priv *priv;
+#ifdef WILC_SPI
+ if (!g_linux_wlan || !g_linux_wlan->wilc_spidev) {
+ netdev_err(ndev, "wilc1000: SPI device not ready\n");
+ return -ENODEV;
+ }
+#endif
nic = netdev_priv(ndev);
priv = wiphy_priv(nic->wilc_netdev->ieee80211_ptr->wiphy);
PRINT_D(INIT_DBG, "MAC OPEN[%p]\n", ndev);
--
2.5.0
next reply other threads:[~2015-09-14 16:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-14 16:51 Chandra S Gorentla [this message]
2015-09-15 5:13 ` [PATCH] drivers: stating: wilc1000: Add a check for SPI availability Sudip Mukherjee
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=1442249474-3014-1-git-send-email-csgorentla@gmail.com \
--to=csgorentla@gmail.com \
--cc=chris.park@atmel.com \
--cc=dean.lee@atmel.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=johnny.kim@atmel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=rachel.kim@atmel.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;
as well as URLs for NNTP newsgroup(s).