[PATCH 3/4] [media] lirc_bt829: Fix iomap leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We must call iounmap() when removed from a device.

Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
 drivers/staging/media/lirc/lirc_bt829.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/lirc/lirc_bt829.c b/drivers/staging/media/lirc/lirc_bt829.c
index 8c5ba2a..76e6cfb 100644
--- a/drivers/staging/media/lirc/lirc_bt829.c
+++ b/drivers/staging/media/lirc/lirc_bt829.c
@@ -140,12 +140,14 @@ static int atir_pci_probe(struct pci_dev *pdev,
 	if (atir->minor < 0) {
 		dev_err(&pdev->dev, "failed to register driver!\n");
 		rc = atir->minor;
-		goto err_free;
+		goto err_unmap;
 	}
 	dprintk("driver is registered on minor %d\n", atir->minor);
 
 	return 0;
 
+err_unmap:
+	iounmap(atir->pci_addr_lin);
 err_free:
 	pci_set_drvdata(pdev, NULL);
 	kfree(atir);
@@ -158,6 +160,7 @@ static void atir_pci_remove(struct pci_dev *pdev)
 	struct atir_device *atir = pci_get_drvdata(pdev);
 
 	lirc_unregister_driver(atir->minor);
+	iounmap(atir->pci_addr_lin);
 	pci_set_drvdata(pdev, NULL);
 	kfree(atir);
 }


Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux