diff mbox

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

Message ID 1378082410.25743.62.camel@deadeye.wl.decadent.org.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Hutchings Sept. 2, 2013, 12:40 a.m. UTC
We must call iounmap() when removed from a device.

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

Patch

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);
 }