提交 a65e8f12 编写于 作者: B Brian King 提交者: 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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
Reviewed-by: NWen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: NDaniel Kreling <kreling@linux.vnet.ibm.com>
Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
上级 2796ca5e
......@@ -9060,13 +9060,15 @@ static void ipr_free_cmd_blks(struct ipr_ioa_cfg *ioa_cfg)
{
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]);
ioa_cfg->ipr_cmnd_list[i] = NULL;
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;
}
}
if (ioa_cfg->ipr_cmd_pool)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册