aic79xx_osm scsi_add_host error checking
Subsystems (3)
PATCH 1/1 aic79xx_osm scsi_add_host error checking
This patch checks for the return value of scsi_add_host.
Signed-off by: Chuck Short <[email protected]>
drivers/scsi/aic7xxx/aic79xx_osm.c +5 -2
@@ -1989,7 +1989,8 @@char *new_name;u_long s;u_long target; - +int error; + template->name = ahd->description; host =scsi_host_alloc (template,sizeof (struct ahd_softc *));if (host ==NULL )
@@ -2065,7 +2066,9 @@ahd_unlock (ahd, &s);#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,5 ,0 ) -scsi_add_host (host, &ahd->dev_softc->dev);/* XXX handle failure */ + error =scsi_add_host (host, &ahd->dev_softc->dev); +if (error) +return (ENOMEM );scsi_scan_host (host);#endif return (0 );
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
drivers/scsi/aic7xxx/aic79xx_osm.c line 1993
Quoted 11 lines · Chuck Short
This patch checks for the return value of
scsi_add_host.drivers/scsi/aic7xxx/aic79xx_osm.c +2
-1@@ -1989,7 +1989,8 @@char *new_name;u_long s;u_long target; - +int error; +
Trailing whitespace.
drivers/scsi/aic7xxx/aic79xx_osm.c line 2071
Quoted 11 lines
drivers/scsi/aic7xxx/aic79xx_osm.c +3
-1template->name = ahd->description; host =scsi_host_alloc (template,sizeof (struct ahd_softc *));if (host =NULL )@@ -2065,7 +2066,9 @@ahd_unlock (ahd, &s);#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,5 ,0 ) -scsi_add_host (host, &ahd->dev_softc->dev);/* XXX handle failure */ + error =scsi_add_host (host, &ahd->dev_softc->dev); +if (error) +return (ENOMEM );
Trailing whitespace.
drivers/scsi/aic7xxx/aic79xx_osm.c line 2074
Quoted 3 lines
drivers/scsi/aic7xxx/aic79xx_osm.c +0
-0scsi_scan_host (host);#endif return (0 );
Also, before scsi_add_host() there is, at least:
host = scsi_host_alloc(template, sizeof(struct ahd_softc *)); new_name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); ahd->platform_data->dv_pid = kernel_thread(ahd_linux_dv_thread, ahd, 0);
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors