diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2010-04-05 04:51:07 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-04-11 14:42:46 -0400 |
commit | 66a679365780a8d775b1ed03e2576007f7100121 (patch) | |
tree | 9e9c4d4341f77fb5692cad739e0392ebcea6ce66 /drivers/scsi/mpt2sas/mpt2sas_base.c | |
parent | ef7c80c1f18f2c5eea2dabd214f12e0c93ac29cf (diff) |
[SCSI] mpt2sas: Check for NULL pointer before free_pages is added.
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>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_base.c')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index b04ccad7d97..b830d61684d 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c | |||
@@ -1919,7 +1919,10 @@ _base_release_memory_pools(struct MPT2SAS_ADAPTER *ioc) | |||
1919 | ioc->config_page, ioc->config_page_dma); | 1919 | ioc->config_page, ioc->config_page_dma); |
1920 | } | 1920 | } |
1921 | 1921 | ||
1922 | free_pages((ulong)ioc->scsi_lookup, ioc->scsi_lookup_pages); | 1922 | if (ioc->scsi_lookup) { |
1923 | free_pages((ulong)ioc->scsi_lookup, ioc->scsi_lookup_pages); | ||
1924 | ioc->scsi_lookup = NULL; | ||
1925 | } | ||
1923 | kfree(ioc->hpr_lookup); | 1926 | kfree(ioc->hpr_lookup); |
1924 | kfree(ioc->internal_lookup); | 1927 | kfree(ioc->internal_lookup); |
1925 | } | 1928 | } |