diff options
author | Brian King <brking@linux.vnet.ibm.com> | 2013-01-11 18:43:48 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-01-29 18:48:51 -0500 |
commit | a2e49cb262208a4c3adec7788ecc1179e07dc912 (patch) | |
tree | ef89704952cd3b04b96010933b8bda9f4bef5c59 | |
parent | b8d5d568a319c1c466cbc6fe1fceaa4a99128a74 (diff) |
[SCSI] ipr: Handler ID memory allocation failure at module load time
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/ipr.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 8d1b806f6022..0a152ef8b741 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -8516,6 +8516,10 @@ static int ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg) | |||
8516 | BITS_TO_LONGS(ioa_cfg->max_devs_supported), GFP_KERNEL); | 8516 | BITS_TO_LONGS(ioa_cfg->max_devs_supported), GFP_KERNEL); |
8517 | ioa_cfg->vset_ids = kzalloc(sizeof(unsigned long) * | 8517 | ioa_cfg->vset_ids = kzalloc(sizeof(unsigned long) * |
8518 | BITS_TO_LONGS(ioa_cfg->max_devs_supported), GFP_KERNEL); | 8518 | BITS_TO_LONGS(ioa_cfg->max_devs_supported), GFP_KERNEL); |
8519 | |||
8520 | if (!ioa_cfg->target_ids || !ioa_cfg->array_ids | ||
8521 | || !ioa_cfg->vset_ids) | ||
8522 | goto out_free_res_entries; | ||
8519 | } | 8523 | } |
8520 | 8524 | ||
8521 | for (i = 0; i < ioa_cfg->max_devs_supported; i++) { | 8525 | for (i = 0; i < ioa_cfg->max_devs_supported; i++) { |
@@ -8591,6 +8595,9 @@ out_free_vpd_cbs: | |||
8591 | ioa_cfg->vpd_cbs, ioa_cfg->vpd_cbs_dma); | 8595 | ioa_cfg->vpd_cbs, ioa_cfg->vpd_cbs_dma); |
8592 | out_free_res_entries: | 8596 | out_free_res_entries: |
8593 | kfree(ioa_cfg->res_entries); | 8597 | kfree(ioa_cfg->res_entries); |
8598 | kfree(ioa_cfg->target_ids); | ||
8599 | kfree(ioa_cfg->array_ids); | ||
8600 | kfree(ioa_cfg->vset_ids); | ||
8594 | goto out; | 8601 | goto out; |
8595 | } | 8602 | } |
8596 | 8603 | ||