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