Skip to content

Commit

Permalink
sgiioc4: fix error cleanup path (take 2)
Browse files Browse the repository at this point in the history
The driver "forgot" to call iounmap() iff request_mem_region() call failed in
sgiioc4_ide_setup_pci_device()...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: jeremy@sgi.com
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Sergei Shtylyov authored and Bartlomiej Zolnierkiewicz committed Oct 23, 2008
1 parent d244118 commit 3059ef9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/ide/sgiioc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,8 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
printk(KERN_ERR "%s %s -- ERROR: addresses 0x%08lx to 0x%08lx "
"already in use\n", DRV_NAME, pci_name(dev),
cmd_phys_base, cmd_phys_base + IOC4_CMD_CTL_BLK_SIZE);
return -EBUSY;
rc = -EBUSY;
goto req_mem_rgn_err;
}

/* Initialize the IO registers */
Expand Down Expand Up @@ -618,6 +619,7 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
ide_host_free(host);
err:
release_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE);
req_mem_rgn_err:
iounmap(virt_base);
return rc;
}
Expand Down

0 comments on commit 3059ef9

Please sign in to comment.