Skip to content

Commit

Permalink
[SCSI] qla2xxx: fix panic caused by previous patch
Browse files Browse the repository at this point in the history
- this patch will fix a panic caused by omitted memory allocation for the nvram.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
Seokmann Ju authored and James Bottomley committed Jul 31, 2007
1 parent 142009a commit 53772a2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/scsi/qla2xxx/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -2266,6 +2279,7 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
ha->fw_dump_reading = 0;

vfree(ha->optrom_buffer);
kfree(ha->nvram);
}

/*
Expand Down

0 comments on commit 53772a2

Please sign in to comment.