提交 53772a2c 编写于 作者: S Seokmann Ju 提交者: James Bottomley

[SCSI] qla2xxx: fix panic caused by previous patch

- this patch will fix a panic caused by omitted memory allocation for the nvram.
Signed-off-by: NSeokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 142009a3
......@@ -2154,6 +2154,19 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
}
}
/* Get memory for cached NVRAM */
ha->nvram = kzalloc(MAX_NVRAM_SIZE, GFP_KERNEL);
if (ha->nvram == NULL) {
/* error */
qla_printk(KERN_WARNING, ha,
"Memory Allocation failed - nvram cache\n");
qla2x00_mem_free(ha);
msleep(100);
continue;
}
/* Done all allocations without any error. */
status = 0;
......@@ -2266,6 +2279,7 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
ha->fw_dump_reading = 0;
vfree(ha->optrom_buffer);
kfree(ha->nvram);
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册