linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/15] staging: ath6kl: Fixing a NULL pointer exception
@ 2011-02-18 21:13 Vipin Mehta
  2011-02-18 21:13 ` [PATCH 02/15] staging: ath6kl: Fixing key settings for WPA/WPA2 Vipin Mehta
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Vipin Mehta @ 2011-02-18 21:13 UTC (permalink / raw)
  To: greg; +Cc: linux-wireless, vmehta, devel

The driver was dereferencing a NULL pointer because of the device instance
being registered via the set_wiphy_dev() function. The function
ar6000_avail_ev() was passing the argument as NULL instead of using the one
returned by the MMC stack through the probe callback.

Signed-off-by: Vipin Mehta <vmehta@atheros.com>
---
 drivers/staging/ath6kl/os/linux/ar6000_drv.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
index 26dafc9..4f6ddf7 100644
--- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c
+++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
@@ -1604,6 +1604,14 @@ ar6000_avail_ev(void *context, void *hif_handle)
     struct wireless_dev *wdev;
 #endif /* ATH6K_CONFIG_CFG80211 */
     int init_status = 0;
+    HIF_DEVICE_OS_DEVICE_INFO osDevInfo;
+
+    memset(&osDevInfo, 0, sizeof(osDevInfo));
+    if (HIFConfigureDevice(hif_handle, HIF_DEVICE_GET_OS_DEVICE,
+        &osDevInfo, sizeof(osDevInfo))) {
+        AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: Failed to get OS device instance\n", __func__));
+        return A_ERROR;
+    }
 
     AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("ar6000_available\n"));
 
@@ -1623,7 +1631,7 @@ ar6000_avail_ev(void *context, void *hif_handle)
     device_index = i;
 
 #ifdef ATH6K_CONFIG_CFG80211
-    wdev = ar6k_cfg80211_init(NULL);
+    wdev = ar6k_cfg80211_init(osDevInfo.pOSDevice);
     if (IS_ERR(wdev)) {
         AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: ar6k_cfg80211_init failed\n", __func__));
         return A_ERROR;
@@ -1668,12 +1676,7 @@ ar6000_avail_ev(void *context, void *hif_handle)
 
 #ifdef SET_NETDEV_DEV
     if (ar_netif) { 
-        HIF_DEVICE_OS_DEVICE_INFO osDevInfo;
-        A_MEMZERO(&osDevInfo, sizeof(osDevInfo));
-        if (!HIFConfigureDevice(hif_handle, HIF_DEVICE_GET_OS_DEVICE,
-				&osDevInfo, sizeof(osDevInfo))) {
-            SET_NETDEV_DEV(dev, osDevInfo.pOSDevice);
-        }
+        SET_NETDEV_DEV(dev, osDevInfo.pOSDevice);
     }
 #endif 
 
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-02-19 10:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-18 21:13 [PATCH 01/15] staging: ath6kl: Fixing a NULL pointer exception Vipin Mehta
2011-02-18 21:13 ` [PATCH 02/15] staging: ath6kl: Fixing key settings for WPA/WPA2 Vipin Mehta
2011-02-18 21:13 ` [PATCH 03/15] staging: ath6kl: Return correct scan complete status Vipin Mehta
2011-02-18 21:13 ` [PATCH 05/15] staging: ath6kl: Fixing driver initialization for manufacturing mode Vipin Mehta
2011-02-18 21:13 ` [PATCH 07/15] staging: ath6kl: Adding support for txop bursting enable/disable Vipin Mehta
2011-02-18 21:13 ` [PATCH 08/15] staging: ath6kl: Fixing a memory leak Vipin Mehta
2011-02-18 21:13 ` [PATCH 10/15] staging: ath6kl: Add configuration for excessive TX retry threshold Vipin Mehta
2011-02-19 10:00   ` Dan Carpenter
2011-02-18 21:13 ` [PATCH 12/15] staging: ath6kl: Fixing the cached copy of the BSS filter set by user Vipin Mehta
2011-02-18 21:13 ` [PATCH 13/15] staging: ath6kl: Adding state in driver to track the sme state Vipin Mehta
2011-02-18 21:13 ` [PATCH 15/15] staging: ath6kl: Fixing disappearing of scan list due to jiffies wrap over Vipin Mehta
2011-02-18 21:29 ` [PATCH 01/15] staging: ath6kl: Fixing a NULL pointer exception Greg KH
2011-02-18 21:56   ` Joe Perches
2011-02-18 22:40     ` Vipin Mehta

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).