- wrong branching: the driver does not want to iounmap() an address that it
has just failed to set;
- return a sensible error status code instead of a success code;
- leak plugged: host was never freed if a late error heppened.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
probe_ent->mmio_base = ioremap(pci_resource_start(pdev, 5),
pci_resource_len(pdev, 5));
- if (probe_ent->mmio_base == NULL)
- goto err_out_iounmap;
+ if (probe_ent->mmio_base == NULL) {
+ rc = -EIO;
+ goto err_out_free_host;
+ }
base = (unsigned long)probe_ent->mmio_base;
err_out_iounmap:
if (host->host_desc->host_flags & NV_HOST_FLAGS_SCR_MMIO)
iounmap(probe_ent->mmio_base);
-
+err_out_free_host:
+ kfree(host);
err_out_free_ent:
kfree(probe_ent);