Skip to content

Commit

Permalink
[SCSI] mpt2sas: Check for NULL pointer before free_pages is added.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kashyap, Desai authored and James Bottomley committed Apr 11, 2010
1 parent ef7c80c commit 66a6793
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/scsi/mpt2sas/mpt2sas_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 66a6793

Please sign in to comment.