Skip to contentSkip to conversation

staging: r8712u: Fix two regressions

PATCH New Larry Finger 1 participant 2 messages Feb 26, 2012 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging: r8712u: Fix two regressions

This patch set fixes regressions introduced in kernel 3.2.

---

V2 - Improved commit message as requested
- Fixed the Tested-by lines

Larry Finger (2):
staging: r8712u: Fix regression introduced by commit a5ee652
staging: r8712u: Fix regression caused by commit 8c213fa

 drivers/staging/rtl8712/os_intfs.c |    5 -----
 drivers/staging/rtl8712/usb_intf.c |    5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.7
#1 lore raw

PATCH v2 2/2 staging: r8712u: Fix regression caused by commit 8c213fa

In commit 8c213fa "staging: r8712u: Use asynchronous firmware loading", the command to release the firmware was placed in the wrong routine.

In combination with the bug introduced in commit a5ee652 "staging: r8712u:
Interface-state not fully tracked", the driver attempts to upload firmware that had already been released. This bug is the source of one of the problems in https://bugs.archlinux.org/task/27996#comment89833.

---

 drivers/staging/rtl8712/os_intfs.c |    3 ---
 drivers/staging/rtl8712/usb_intf.c |    5 +++++
 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/staging/rtl8712/os_intfs.c +0 -3
index 4cf175f..7bbd53a 100644
@@ -475,9 +475,6 @@ static int netdev_close(struct net_device *pnetdev)
 	r8712_free_assoc_resources(padapter);
 	/*s2-4.*/
 	r8712_free_network_queue(padapter);
-	release_firmware(padapter->fw);
-	/* never exit with a firmware callback pending */
-	wait_for_completion(&padapter->rtl8712_fw_ready);
 	return 0;
 }
 
drivers/staging/rtl8712/usb_intf.c +5 -0
index fe0e2ff..e01fe14 100644
@@ -30,6 +30,7 @@
 
 #include <linux/usb.h>
 #include <linux/module.h>
+#include <linux/firmware.h>
 
 #include "osdep_service.h"
 #include "drv_types.h"
@@ -620,6 +621,10 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
 	struct _adapter *padapter = netdev_priv(pnetdev);
 	struct usb_device *udev = interface_to_usbdev(pusb_intf);
 
+	if (padapter->fw_found)
+		release_firmware(padapter->fw);
+	/* never exit with a firmware callback pending */
+	wait_for_completion(&padapter->rtl8712_fw_ready);
 	usb_set_intfdata(pusb_intf, NULL);
 	if (padapter) {
 		if (drvpriv.drv_registered == true)
Signature · 1 line
1.7.7