* [KJ] [PATCH] aic79xx_osm scsi_add_host error checking
@ 2005-05-30 2:06 Chuck Short
2005-05-30 6:25 ` Alexey Dobriyan
0 siblings, 1 reply; 2+ messages in thread
From: Chuck Short @ 2005-05-30 2:06 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 104 bytes --]
This patch checks for the return value of scsi_add_host.
Signed-off by: Chuck Short <zuclss@gmail.com>
[-- Attachment #2: aic79xx_osm-scsi_add_host_error_checking.dpatch --]
[-- Type: text/plain, Size: 868 bytes --]
diff -Naur linux-source-2.6.12-2.6.11.93.orig/drivers/scsi/aic7xxx/aic79xx_osm.c linux-source-2.6.12-2.6.11.93/drivers/scsi/aic7xxx/aic79xx_osm.c
--- linux-source-2.6.12-2.6.11.93.orig/drivers/scsi/aic7xxx/aic79xx_osm.c 2005-04-21 06:39:57.000000000 -0400
+++ linux-source-2.6.12-2.6.11.93/drivers/scsi/aic7xxx/aic79xx_osm.c 2005-05-29 21:12:45.099645176 -0400
@@ -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);
[-- Attachment #3: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [KJ] [PATCH] aic79xx_osm scsi_add_host error checking
2005-05-30 2:06 [KJ] [PATCH] aic79xx_osm scsi_add_host error checking Chuck Short
@ 2005-05-30 6:25 ` Alexey Dobriyan
0 siblings, 0 replies; 2+ messages in thread
From: Alexey Dobriyan @ 2005-05-30 6:25 UTC (permalink / raw)
To: kernel-janitors
On Monday 30 May 2005 06:06, Chuck Short wrote:
> This patch checks for the return value of scsi_add_host.
> --- linux-source-2.6.12-2.6.11.93.orig/drivers/scsi/aic7xxx/aic79xx_osm.c
> +++ linux-source-2.6.12-2.6.11.93/drivers/scsi/aic7xxx/aic79xx_osm.c
> @@ -1989,7 +1989,8 @@
> char *new_name;
> u_long s;
> u_long target;
> -
> + int error;
> +
Trailing whitespace.
> 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);
Trailing whitespace.
> scsi_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
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-05-30 6:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-30 2:06 [KJ] [PATCH] aic79xx_osm scsi_add_host error checking Chuck Short
2005-05-30 6:25 ` Alexey Dobriyan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.