mirror of
https://github.com/torvalds/linux
synced 2024-10-27 13:48:49 +00:00
staging: ath6kl: Fixing a NULL pointer exception
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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
6642a67c55
commit
da101d5635
|
@ -1604,6 +1604,14 @@ ar6000_avail_ev(void *context, void *hif_handle)
|
||||||
struct wireless_dev *wdev;
|
struct wireless_dev *wdev;
|
||||||
#endif /* ATH6K_CONFIG_CFG80211 */
|
#endif /* ATH6K_CONFIG_CFG80211 */
|
||||||
int init_status = 0;
|
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"));
|
AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("ar6000_available\n"));
|
||||||
|
|
||||||
|
@ -1623,7 +1631,7 @@ ar6000_avail_ev(void *context, void *hif_handle)
|
||||||
device_index = i;
|
device_index = i;
|
||||||
|
|
||||||
#ifdef ATH6K_CONFIG_CFG80211
|
#ifdef ATH6K_CONFIG_CFG80211
|
||||||
wdev = ar6k_cfg80211_init(NULL);
|
wdev = ar6k_cfg80211_init(osDevInfo.pOSDevice);
|
||||||
if (IS_ERR(wdev)) {
|
if (IS_ERR(wdev)) {
|
||||||
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: ar6k_cfg80211_init failed\n", __func__));
|
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: ar6k_cfg80211_init failed\n", __func__));
|
||||||
return A_ERROR;
|
return A_ERROR;
|
||||||
|
@ -1668,12 +1676,7 @@ ar6000_avail_ev(void *context, void *hif_handle)
|
||||||
|
|
||||||
#ifdef SET_NETDEV_DEV
|
#ifdef SET_NETDEV_DEV
|
||||||
if (ar_netif) {
|
if (ar_netif) {
|
||||||
HIF_DEVICE_OS_DEVICE_INFO osDevInfo;
|
SET_NETDEV_DEV(dev, osDevInfo.pOSDevice);
|
||||||
A_MEMZERO(&osDevInfo, sizeof(osDevInfo));
|
|
||||||
if (!HIFConfigureDevice(hif_handle, HIF_DEVICE_GET_OS_DEVICE,
|
|
||||||
&osDevInfo, sizeof(osDevInfo))) {
|
|
||||||
SET_NETDEV_DEV(dev, osDevInfo.pOSDevice);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue