Browse Source

Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6:
  Staging: w35und: fix usb_control_msg() error handling in wb35_probe()
  Staging: w35und: fix registration with wlan stack
  Staging: panel: fix oops on panel_cleanup_module
  Staging: rtl8187se: Fix oops and memory poison caused by builtin ieee80211.
  Staging: rtl8187se: fix Kconfig dependencies
Linus Torvalds 16 years ago
parent
commit
778ef1e6cb

+ 12 - 11
drivers/staging/panel/panel.c

@@ -2164,19 +2164,20 @@ static void __exit panel_cleanup_module(void)
 	if (scan_timer.function != NULL)
 	if (scan_timer.function != NULL)
 		del_timer(&scan_timer);
 		del_timer(&scan_timer);
 
 
-	if (keypad_enabled)
-		misc_deregister(&keypad_dev);
+	if (pprt != NULL) {
+		if (keypad_enabled)
+			misc_deregister(&keypad_dev);
+
+		if (lcd_enabled) {
+			panel_lcd_print("\x0cLCD driver " PANEL_VERSION
+					"\nunloaded.\x1b[Lc\x1b[Lb\x1b[L-");
+			misc_deregister(&lcd_dev);
+		}
 
 
-	if (lcd_enabled) {
-		panel_lcd_print("\x0cLCD driver " PANEL_VERSION
-				"\nunloaded.\x1b[Lc\x1b[Lb\x1b[L-");
-		misc_deregister(&lcd_dev);
+		/* TODO: free all input signals */
+		parport_release(pprt);
+		parport_unregister_device(pprt);
 	}
 	}
-
-	/* TODO: free all input signals */
-
-	parport_release(pprt);
-	parport_unregister_device(pprt);
 	parport_unregister_driver(&panel_driver);
 	parport_unregister_driver(&panel_driver);
 }
 }
 
 

+ 1 - 0
drivers/staging/rtl8187se/Kconfig

@@ -1,5 +1,6 @@
 config RTL8187SE
 config RTL8187SE
 	tristate "RealTek RTL8187SE Wireless LAN NIC driver"
 	tristate "RealTek RTL8187SE Wireless LAN NIC driver"
 	depends on PCI
 	depends on PCI
+	depends on WIRELESS_EXT && COMPAT_NET_DEV_OPS
 	default N
 	default N
 	---help---
 	---help---

+ 10 - 9
drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c

@@ -234,20 +234,21 @@ out:
 void ieee80211_crypto_deinit(void)
 void ieee80211_crypto_deinit(void)
 {
 {
 	struct list_head *ptr, *n;
 	struct list_head *ptr, *n;
+	struct ieee80211_crypto_alg *alg = NULL;
 
 
 	if (hcrypt == NULL)
 	if (hcrypt == NULL)
 		return;
 		return;
 
 
-	for (ptr = hcrypt->algs.next, n = ptr->next; ptr != &hcrypt->algs;
-	     ptr = n, n = ptr->next) {
-		struct ieee80211_crypto_alg *alg =
-			(struct ieee80211_crypto_alg *) ptr;
-		list_del(ptr);
-		printk(KERN_DEBUG "ieee80211_crypt: unregistered algorithm "
-		       "'%s' (deinit)\n", alg->ops->name);
-		kfree(alg);
+	list_for_each_safe(ptr, n, &hcrypt->algs) {
+		alg = list_entry(ptr, struct ieee80211_crypto_alg, list);
+		if (alg) {
+			list_del(ptr);
+			printk(KERN_DEBUG
+			       "ieee80211_crypt: unregistered algorithm '%s' (deinit)\n",
+			       alg->ops->name);
+			kfree(alg);
+		}
 	}
 	}
-
 	kfree(hcrypt);
 	kfree(hcrypt);
 }
 }
 
 

+ 1 - 1
drivers/staging/rtl8187se/r8180_core.c

@@ -6161,10 +6161,10 @@ static void __exit rtl8180_pci_module_exit(void)
 {
 {
 	pci_unregister_driver (&rtl8180_pci_driver);
 	pci_unregister_driver (&rtl8180_pci_driver);
 	rtl8180_proc_module_remove();
 	rtl8180_proc_module_remove();
-	ieee80211_crypto_deinit();
 	ieee80211_crypto_tkip_exit();
 	ieee80211_crypto_tkip_exit();
 	ieee80211_crypto_ccmp_exit();
 	ieee80211_crypto_ccmp_exit();
 	ieee80211_crypto_wep_exit();
 	ieee80211_crypto_wep_exit();
+	ieee80211_crypto_deinit();
 	DMESG("Exiting");
 	DMESG("Exiting");
 }
 }
 
 

+ 13 - 7
drivers/staging/winbond/wbusb.c

@@ -319,16 +319,18 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
 	struct usb_device *udev = interface_to_usbdev(intf);
 	struct usb_device *udev = interface_to_usbdev(intf);
 	struct wbsoft_priv *priv;
 	struct wbsoft_priv *priv;
 	struct ieee80211_hw *dev;
 	struct ieee80211_hw *dev;
-	int err;
+	int nr, err;
 
 
 	usb_get_dev(udev);
 	usb_get_dev(udev);
 
 
 	// 20060630.2 Check the device if it already be opened
 	// 20060630.2 Check the device if it already be opened
-	err = usb_control_msg(udev, usb_rcvctrlpipe( udev, 0 ),
-			      0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN,
-			      0x0, 0x400, &ltmp, 4, HZ*100 );
-	if (err)
+	nr = usb_control_msg(udev, usb_rcvctrlpipe( udev, 0 ),
+			     0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN,
+			     0x0, 0x400, &ltmp, 4, HZ*100 );
+	if (nr < 0) {
+		err = nr;
 		goto error;
 		goto error;
+	}
 
 
 	ltmp = cpu_to_le32(ltmp);
 	ltmp = cpu_to_le32(ltmp);
 	if (ltmp) {  // Is already initialized?
 	if (ltmp) {  // Is already initialized?
@@ -337,8 +339,10 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
 	}
 	}
 
 
 	dev = ieee80211_alloc_hw(sizeof(*priv), &wbsoft_ops);
 	dev = ieee80211_alloc_hw(sizeof(*priv), &wbsoft_ops);
-	if (!dev)
+	if (!dev) {
+		err = -ENOMEM;
 		goto error;
 		goto error;
+	}
 
 
 	priv = dev->priv;
 	priv = dev->priv;
 
 
@@ -369,9 +373,11 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
 	}
 	}
 
 
 	dev->extra_tx_headroom = 12;	/* FIXME */
 	dev->extra_tx_headroom = 12;	/* FIXME */
-	dev->flags = 0;
+	dev->flags = IEEE80211_HW_SIGNAL_UNSPEC;
+	dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
 
 
 	dev->channel_change_time = 1000;
 	dev->channel_change_time = 1000;
+	dev->max_signal = 100;
 	dev->queues = 1;
 	dev->queues = 1;
 
 
 	dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &wbsoft_band_2GHz;
 	dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &wbsoft_band_2GHz;