[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1360108823-5141-1-git-send-email-Larry.Finger@lwfinger.net>
Date: Tue, 5 Feb 2013 18:00:23 -0600
From: Larry Finger <Larry.Finger@...inger.net>
To: linville@...driver.com
Cc: linux-wireless@...r.kernel.org,
Larry Finger <Larry.Finger@...inger.net>,
netdev@...r.kernel.org, Stable <stable@...r.kernel.org>
Subject: [PATCH] rtlwifi: rtl8192cu: Fix NULL dereference BUG when using new_id
When the new_id entry is used for a foreign USB device, rtlwifi BUGS with
a NULL pointer dereference.
Signed-off-by: Larry Finger <Larry.Finger@...inger.net>
Cc: Stable <stable@...r.kernel.org>
---
John,
Although this patch should be backported to stable kernels, the new_id
feature is rarely used, thus the patch should not have any particular
priority.
Larry
---
drivers/net/wireless/rtlwifi/usb.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index d42bbe2..77a7517 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -977,6 +977,9 @@ int rtl_usb_probe(struct usb_interface *intf,
rtl_dbgp_flag_init(hw);
/* Init IO handler */
_rtl_usb_io_handler_init(&udev->dev, hw);
+ if (!rtlpriv->cfg || !rtlpriv->cfg->ops ||
+ !rtlpriv->cfg->ops->read_chip_version)
+ return -ENODEV;
rtlpriv->cfg->ops->read_chip_version(hw);
/*like read eeprom and so on */
rtlpriv->cfg->ops->read_eeprom_info(hw);
--
1.8.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists