Skip to contentSkip to conversation

qla2xxx: fix panic caused by previous patch

PATCH In review Seokmann Ju 2 participants 2 messages Jul 30, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qla2xxx: fix panic caused by previous patch

As a fix to the issue initiated by the email thread 'qla2xyz broken in current Linus tree', Following patch should fix the problem.

Thank you,
Seokmann
---

Quoted 1 line

From d0355c3c61a12ce466c87d8ef953425d2b21725b Mon Sep 17 00:00:00 2001

From: Seokmann Ju <[email protected]>
Date: Mon, 30 Jul 2007 13:12:17 -0400
Subject: [PATCH] qla2xxx: fix panic caused by previous patch

- this patch will fix a panic caused by omitted memory allocation for the nvram.

---
 drivers/scsi/qla2xxx/qla_os.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +14 -0
index 8bdc5a2..33d5d80 100644
@@ -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);
 }
 
 /*
Signature · 1 line
1.5.2
Quoted 1 line

From d0355c3c61a12ce466c87d8ef953425d2b21725b Mon Sep 17 00:00:00 2001

From: Seokmann Ju <[email protected]>
Date: Mon, 30 Jul 2007 13:12:17 -0400
Subject: [PATCH] qla2xxx: fix panic caused by previous patch

- this patch will fix a panic caused by omitted memory allocation for the nvram.

---
 drivers/scsi/qla2xxx/qla_os.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +14 -0
index 8bdc5a2..33d5d80 100644
@@ -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);
 }
 
 /*
Signature · 1 line
1.5.2
#1 lore raw
Quoted 2 lines · Seokmann Ju

As a fix to the issue initiated by the email thread 'qla2xyz broken in current Linus tree', Following patch should fix the problem.

Confirmed. Thanks!

Signature · 3 lines
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."