staging: rtl8192e: Fix unload/reload problem
authorLarry Finger <Larry.Finger@lwfinger.net>
Fri, 15 Jul 2011 17:32:41 +0000 (12:32 -0500)
committerLarry Finger <Larry.Finger@lwfinger.net>
Wed, 24 Aug 2011 02:47:22 +0000 (21:47 -0500)
The driver is not releasing the memory region that was mapped. As a result,
the driver cannot be unloaded and reloaded.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
drivers/staging/rtl8192e/rtl_core.c

index f8040acb91d11ec0f22b83a7a6a8fc890ca95bac..f8a13d95985b4c6fa8c0764f6cd89ffd0e1ee5d5 100644 (file)
@@ -3122,6 +3122,11 @@ static void __devexit rtl8192_pci_disconnect(struct pci_dev *pdev)
                if (priv->scan_cmd)
                        kfree(priv->scan_cmd);
 
+               if (dev->mem_start != 0) {
+                       iounmap((void *)dev->mem_start);
+                       release_mem_region(pci_resource_start(pdev, 1),
+                                          pci_resource_len(pdev, 1));
+               }
        } else{
                priv=rtllib_priv(dev);
         }