Skip to contentSkip to conversation

scsi_register-004

PATCH New Rusty Trivial Russell 1 participant 1 message Dec 16, 2002 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi_register-004

(Included in 2.5)
From: Michael Still <[email protected]>

This patch has been generated as part of my scsi_register audit of the 2.5.45 kernel tree. scsi_register() can fail, returning a NULL pointer, and the failure case was not being handled here...

drivers/scsi/gdth.c renamed from drivers/scsi/gdth.c.orig +3 -0
@@ -4029,6 +4029,9 @@
             break;
         if (gdth_search_isa(isa_bios)) {        /* controller found */
             shp = scsi_register(shtp,sizeof(gdth_ext_str));
+	    if(shp == NULL)
+		    continue;
+
             ha = HADATA(shp);
             if (!gdth_init_isa(isa_bios,ha)) {
                 scsi_unregister(shp);
Signature · 2 lines
  Don't blame me: the Monkey is driving
  File: Michael Still <[email protected]>: [Trivial Patch] scsi_register-004