diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2013-02-06 22:54:17 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-02-08 23:51:34 +0400 |
commit | 957f4aca5fa0db69635271bc4621cc0b65b2d590 (patch) | |
tree | afccf897b7a9d6e91c028f66a851ce0631ca64f2 /drivers/net/wireless/rtlwifi/usb.c | |
parent | cbb1ec9491fdbd3aa9dee6ad9a3bcb05bdfd279d (diff) | |
download | linux-957f4aca5fa0db69635271bc4621cc0b65b2d590.tar.xz |
rtlwifi: rtl8192cu: Fix NULL dereference BUG when using new_id
When the new_id entry in /sysfs is used for a foreign USB device, rtlwifi
BUGS with a NULL pointer dereference because the per-driver configuration
data is not available. The probe function has been restructured as
suggested by Ben Hutchings <bhutchings@solarflare.com>.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtlwifi/usb.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/usb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index af5423cc5b0f..80730c72e0d6 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c @@ -937,7 +937,8 @@ static struct rtl_intf_ops rtl_usb_ops = { }; int rtl_usb_probe(struct usb_interface *intf, - const struct usb_device_id *id) + const struct usb_device_id *id, + struct rtl_hal_cfg *rtl_hal_cfg) { int err; struct ieee80211_hw *hw = NULL; @@ -972,7 +973,7 @@ int rtl_usb_probe(struct usb_interface *intf, usb_set_intfdata(intf, hw); /* init cfg & intf_ops */ rtlpriv->rtlhal.interface = INTF_USB; - rtlpriv->cfg = (struct rtl_hal_cfg *)(id->driver_info); + rtlpriv->cfg = rtl_hal_cfg; rtlpriv->intf_ops = &rtl_usb_ops; rtl_dbgp_flag_init(hw); /* Init IO handler */ |