Skip to contentSkip to conversation

inia100.c: pointer used before being set

PATCH In review Randy.Dunlap 2 participants 4 messages Jan 13, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 inia100.c: pointer used before being set

drivers/scsi/inia100.c:421: warning: `pHCB' might be used uninitialized in this function

I see a problem there, patch is below. Warning is still there, however, so this doesn't fix the warning, just fixes a real bug.

changelog: use local <port> since pHCB is not set yet;

product_versions: Linux 2.6.1
Please apply.

diffstat:=

drivers/scsi/inia100.c renamed from drivers/scsi/inia100.c~inia_warn +2 -2
diff -Naurp ./drivers/scsi/inia100.c~inia_warn ./drivers/scsi/inia100.c
@@ -434,9 +434,9 @@ static int __devinit inia100_probe_one(s
 	}
 
 	port = pci_resource_start(pdev, 0);
-	if (!request_region(pHCB->HCS_Base, 256, "inia100")) {
+	if (!request_region(port, 256, "inia100")) {
 		printk(KERN_WARNING "inia100: io port 0x%x, is busy.\n", 
-		       pHCB->HCS_Base);
+		       port);
 		goto out_disable_device; /* XXX: undo init_orchid() ?? */
 	}
 

--
~Randy

#1 lore raw
Quoted 1 line · Randy.Dunlap

drivers/scsi/inia100.c:421: warning: `pHCB' might be used uninitialized in this function

I think I've got a different (and slightly more extensive) fix already in the scsi-misc-2.7 tree:

[email protected], 2004-01-05 22:03:53-06:00, [email protected]
[PATCH] fix inia100 driver

John W Fort helped me debugging the brown paperbag bugs, the patch
below
makes it work.

James

#2 lore raw

On 13 Jan 2004 00:17:07 -0500 James Bottomley <[email protected]> wrote:

| On Tue, 2004-01-13 at 00:07, Randy.Dunlap wrote:
| > drivers/scsi/inia100.c:421: warning: `pHCB' might be used uninitialized in this function
| 
| I think I've got a different (and slightly more extensive) fix already
| in the scsi-misc-2.7 tree:
| 
| [email protected], 2004-01-05 22:03:53-06:00, [email protected]
|   [PATCH] fix inia100 driver
|   
|   John W Fort helped me debugging the brown paperbag bugs, the patch
| below
|   makes it work.

OK, I looked for scsi-patch trees and just didn't look in one named with "2.7" in it since I think that this should be fixed before then.

--
~Randy

#3 lore raw
Quoted 3 lines · Randy.Dunlap

OK, I looked for scsi-patch trees and just didn't look in one named with "2.7" in it since I think that this should be fixed before then.

Yes, sorry, bad tree name...I picked it when I wasn't sure if I'd get any of the driver patches in after 2.6.0....I'll rename it in the next go around.

James