[PATCH 1/1] aacraid: prevent panic on adapter resource failure

Salyzyn, Mark
2007-08-02T19:39:04Z

[-- Attachment #1: Type: text/plain, Size: 652 bytes --]

If the driver fails to allocate the contiguous (DMAable) memory for
system reasons, we fail to load the instance, but then we try to free
the <nul> allocation in the cleanup code and we get a panic in
pci_free_consistent(). This is reported against an older kernel, hope
this is relevant for latest/greatest.

This attached patch is against current scsi-misc-2.6.

ObligatoryDisclaimer: Please accept my condolences regarding Outlook's
handling of patch attachments.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>

drivers/scsi/aacraid/linit.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Sincerely -- Mark Salyzyn

[-- Attachment #2: aacraid_fail_to_load_panic.patch --]
[-- Type: application/octet-stream, Size: 561 bytes --]

diff -ru a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
--- a/drivers/scsi/aacraid/linit.c 2007-08-02 15:30:35.489215671 -0400
+++ b/drivers/scsi/aacraid/linit.c 2007-08-02 15:30:41.567415315 -0400
@@ -1110,7 +1110,9 @@
__aac_shutdown(aac);
out_unmap:
aac_fib_map_free(aac);
- pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys);
+ if (aac->comm_addr)
+ pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr,
+ aac->comm_phys);
kfree(aac->queues);
aac_adapter_ioremap(aac, 0);
kfree(aac->fibs);