[SCSI] mpt2sas: Check for NULL pointer before free_pages is added.
authorKashyap, Desai <kashyap.desai@lsi.com>
Mon, 5 Apr 2010 08:51:07 +0000 (14:21 +0530)
committerJames Bottomley <James.Bottomley@suse.de>
Sun, 11 Apr 2010 18:42:46 +0000 (13:42 -0500)
Added check before free_pages just to make sure ioc->scsi_lookup is not NULL.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/mpt2sas/mpt2sas_base.c

index b04ccad7d972fee991db4213a19fc3087f36b038..b830d61684ddb35fafb13401c106881b1070bb46 100644 (file)
@@ -1919,7 +1919,10 @@ _base_release_memory_pools(struct MPT2SAS_ADAPTER *ioc)
                    ioc->config_page, ioc->config_page_dma);
        }
 
-       free_pages((ulong)ioc->scsi_lookup, ioc->scsi_lookup_pages);
+       if (ioc->scsi_lookup) {
+               free_pages((ulong)ioc->scsi_lookup, ioc->scsi_lookup_pages);
+               ioc->scsi_lookup = NULL;
+       }
        kfree(ioc->hpr_lookup);
        kfree(ioc->internal_lookup);
 }