[SCSI] sym53c8xx: unmap pci memory after probe errors
authorTony Battersby <tonyb@cybernetics.com>
Thu, 8 Jan 2009 17:55:52 +0000 (12:55 -0500)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Thu, 12 Mar 2009 17:58:16 +0000 (12:58 -0500)
commita71d035de835caa7d14ef69928e0fde9fc241cc0
treeeb44f1a045b1d7d8b762c19520437ce9e3a12179
parentb409063a9b7a56c0d658feaffedeb74ad71edce7
[SCSI] sym53c8xx: unmap pci memory after probe errors

During sym2_probe(), sym_init_device() does pci_iomap(), but there is
no corresponding pci_iounmap() if an error occurs before sym_attach()
copies sym_device::s.{ioaddr,ramaddr} to np.
1) Add the sym_iounmap_device() function.
2) Call sym_iounmap_device() if an error occurs between
   sym_init_device() and the time sym_attach() allocates np.
3) Make sym_attach() copy sym_device::s.{ioaddr,ramaddr} to np before
   calling any function that can fail so that sym_free_resources()
   will do the unmap instead of sym_iounmap_device().

Also fixed by this patch:
During sym2_probe(), if sym_check_raid() returns nonzero, then
pci_release_regions() is never called.

Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/sym53c8xx_2/sym_glue.c