** Adding 'Reviewed-by' tag **
Fixes a possible oops during adapter initialization in some
memory allocation failure error paths scenarios.
Reported-by: Dan Carpenter
Signed-off-by: Brian King
Reviewed-by: Daniel Kreling
---
drivers/scsi/ipr.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
=======================================
diff -puN drivers/scsi/ipr.c~ipr_free_cmd_blks_oops drivers/scsi/ipr.c
--- linux/drivers/scsi/ipr.c~ipr_free_cmd_blks_oops 2015-03-26
11:14:41.465782868 -0500
+++ linux-bjking1/drivers/scsi/ipr.c 2015-03-26 11:14:41.471782829 -0500
@@ -9061,1 +9061,1 @@
static·void·ipr_free_cmd_blks(struct·ipr
{
int i;
- for (i = 0; i < IPR_NUM_CMD_BLKS; i++) {
- if (ioa_cfg->ipr_cmnd_list[i])
- dma_pool_free(ioa_cfg->ipr_cmd_pool,
- ioa_cfg->ipr_cmnd_list[i],
- ioa_cfg->ipr_cmnd_list_dma[i]);
+ if (ioa_cfg->ipr_cmnd_list) {
+ for (i = 0; i < IPR_NUM_CMD_BLKS; i++) {
+ if (ioa_cfg->ipr_cmnd_list[i])
+ dma_pool_free(ioa_cfg->ipr_cmd_pool,
+ ioa_cfg->ipr_cmnd_list[i],
+ ioa_cfg->ipr_cmnd_list_dma[i]);
- ioa_cfg->ipr_cmnd_list[i] = NULL;
+ ioa_cfg->ipr_cmnd_list[i] = NULL;
+ }
}
if (ioa_cfg->ipr_cmd_pool)
_
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html