Search Linux Wireless

[PATCH] zd1211rw-mac80211: Fix NULL dereference on installer exit path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When dealing with a DEVICE_INSTALLER, dev will be NULL when disconnect()
is called. This fixes a NULL dereference oops with such devices.

Signed-off-by: Daniel Drake <dsd@xxxxxxxxxx>
---
 drivers/net/wireless/mac80211/zd1211rw/zd_usb.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mac80211/zd1211rw/zd_usb.c b/drivers/net/wireless/mac80211/zd1211rw/zd_usb.c
index 8867110..24d22dc 100644
--- a/drivers/net/wireless/mac80211/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/mac80211/zd1211rw/zd_usb.c
@@ -978,14 +978,17 @@ error:
 static void disconnect(struct usb_interface *intf)
 {
 	struct ieee80211_hw *dev = zd_intf_to_dev(intf);
-	struct zd_mac *mac = zd_dev_mac(dev);
-	struct zd_usb *usb = &mac->chip.usb;
+	struct zd_mac *mac;
+	struct zd_usb *usb;
 
 	/* Either something really bad happened, or we're just dealing with
 	 * a DEVICE_INSTALLER. */
 	if (dev == NULL)
 		return;
 
+	mac = zd_dev_mac(dev);
+	usb = &mac->chip.usb;
+
 	dev_dbg_f(zd_usb_dev(usb), "\n");
 
 	ieee80211_unregister_hw(dev);
-- 
1.5.0.5

-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux