Commit a65e8f12 authored by Brian King's avatar Brian King Committed by James Bottomley

ipr: Fix possible error path oops during initialization

Fixes a possible oops during adapter initialization in some
memory allocation failure error paths scenarios.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
Reviewed-by: default avatarWen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: default avatarDaniel Kreling <kreling@linux.vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent 2796ca5e
...@@ -9060,6 +9060,7 @@ static void ipr_free_cmd_blks(struct ipr_ioa_cfg *ioa_cfg) ...@@ -9060,6 +9060,7 @@ static void ipr_free_cmd_blks(struct ipr_ioa_cfg *ioa_cfg)
{ {
int i; int i;
if (ioa_cfg->ipr_cmnd_list) {
for (i = 0; i < IPR_NUM_CMD_BLKS; i++) { for (i = 0; i < IPR_NUM_CMD_BLKS; i++) {
if (ioa_cfg->ipr_cmnd_list[i]) if (ioa_cfg->ipr_cmnd_list[i])
dma_pool_free(ioa_cfg->ipr_cmd_pool, dma_pool_free(ioa_cfg->ipr_cmd_pool,
...@@ -9068,6 +9069,7 @@ static void ipr_free_cmd_blks(struct ipr_ioa_cfg *ioa_cfg) ...@@ -9068,6 +9069,7 @@ static void ipr_free_cmd_blks(struct ipr_ioa_cfg *ioa_cfg)
ioa_cfg->ipr_cmnd_list[i] = NULL; ioa_cfg->ipr_cmnd_list[i] = NULL;
} }
}
if (ioa_cfg->ipr_cmd_pool) if (ioa_cfg->ipr_cmd_pool)
dma_pool_destroy(ioa_cfg->ipr_cmd_pool); dma_pool_destroy(ioa_cfg->ipr_cmd_pool);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment