staging: rtl8192e: probe: iounmap mmio when probe fails
authorMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Tue, 28 Jul 2015 21:31:47 +0000 (23:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 Jul 2015 23:21:37 +0000 (16:21 -0700)
In case of probe failure, io memory was not released properly.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/rtl_core.c

index 0033cfb21351d9f0af5f13e2fbaa5106085a0aec..c868cb373a4b8a6f58f01e02a4909e5d059c22fb 100644 (file)
@@ -2642,12 +2642,12 @@ static int rtl8192_pci_probe(struct pci_dev *pdev,
        pci_read_config_byte(pdev, 0x08, &revision_id);
        /* If the revisionid is 0x10, the device uses rtl8192se. */
        if (pdev->device == 0x8192 && revision_id == 0x10)
-               goto err_rel_mem;
+               goto err_unmap;
 
        priv->ops = ops;
 
        if (rtl92e_check_adapter(pdev, dev) == false)
-               goto err_rel_mem;
+               goto err_unmap;
 
        dev->irq = pdev->irq;
        priv->irq = 0;
@@ -2688,6 +2688,8 @@ static int rtl8192_pci_probe(struct pci_dev *pdev,
 err_free_irq:
        free_irq(dev->irq, dev);
        priv->irq = 0;
+err_unmap:
+       iounmap((void __iomem *)ioaddr);
 err_rel_mem:
        release_mem_region(pmem_start, pmem_len);
 err_rel_rtllib: