Skip to contentSkip to conversation

[2.6.1] Kernel panic with ppa driver updates

PATCH walt 1 participant 1 message Feb 8, 2004 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

walt

author
#2 lore raw
Quoted 27 lines · [email protected] wrote:
Quoted 3 lines · walt

ppa: Version 2.07 (for Linux 2.4.x)
dev = dfd67940, dev->cur_cmd = 7232b2df

Unable to handle kernel paging request at virtual address 7232b403

Aaaaaargh.... memset(dev, 0, sizeof(dev)); - spot the bug here...

Fix follows. Linus, apply it, please. Amazing that it survives in modular case...

diff -urN RC2-bk1-base/drivers/scsi/imm.c RC2-bk1-current/drivers/scsi/imm.c

drivers/scsi/imm.c +1 -1
@@ -1153,7 +1153,7 @@
 	if (!dev)
 		return -ENOMEM;
 
-	memset(dev, 0, sizeof(dev));
+	memset(dev, 0, sizeof(imm_struct));
 
 	dev->base = -1;
 	dev->mode = IMM_AUTODETECT;

diff -urN RC2-bk1-base/drivers/scsi/ppa.c RC2-bk1-current/drivers/scsi/ppa.c

drivers/scsi/ppa.c

Quoted 9 lines
drivers/scsi/ppa.c +1 -2
@@ -1010,7 +1010,7 @@
 	dev = kmalloc(sizeof(ppa_struct), GFP_KERNEL);
 	if (!dev)
 		return -ENOMEM;
-	memset(dev, 0, sizeof(dev));
+	memset(dev, 0, sizeof(ppa_struct));
 	dev->base = -1;
 	dev->mode = PPA_AUTODETECT;
 	dev->recon_tmo = PPA_RECON_TMO;
-

Yes, it's fixed now. Thank you!