Spotted by Francois Romieu.
probe_ent->mmio_base = ioremap(pci_resource_start(pdev, 5),
pci_resource_len(pdev, 5));
if (probe_ent->mmio_base == NULL)
- goto err_out_free_ent;
+ goto err_out_iounmap;
base = (unsigned long)probe_ent->mmio_base;
rc = ata_device_add(probe_ent);
if (rc != NV_PORTS)
- goto err_out_free_ent;
+ goto err_out_iounmap;
kfree(probe_ent);
return 0;
+err_out_iounmap:
+ if (host->host_desc->host_flags & NV_HOST_FLAGS_SCR_MMIO)
+ iounmap(probe_ent->mmio_base);
+
err_out_free_ent:
kfree(probe_ent);