All of lore.kernel.org
 help / color / mirror / Atom feed
* mark scsi_add_host() as __must_check
@ 2004-08-23 11:24 Arjan van de Ven
  0 siblings, 0 replies; only message in thread
From: Arjan van de Ven @ 2004-08-23 11:24 UTC (permalink / raw)
  To: linux-scsi

Hi,

It seems it's a dangerous trap to write the following code:

        scsi_add_host(host, &pdev->dev);
        scsi_scan_host(host);

without checking the return value of scsi_add_host; it seems scsi_add_host()
is one of those functions that you reall have to check the return value of,
this patch makes it so:

--- linux-2.6.7/include/scsi/scsi_host.h~	2004-08-03 11:33:19.127693290 +0200
+++ linux-2.6.7/include/scsi/scsi_host.h	2004-08-03 11:33:19.127693290 +0200
@@ -524,7 +524,7 @@
 	container_of(d, struct Scsi_Host, shost_classdev)
 
 extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int);
-extern int scsi_add_host(struct Scsi_Host *, struct device *);
+extern int __must_check scsi_add_host(struct Scsi_Host *, struct device *);
 extern void scsi_scan_host(struct Scsi_Host *);
 extern void scsi_remove_host(struct Scsi_Host *);
 extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-08-23 11:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-23 11:24 mark scsi_add_host() as __must_check Arjan van de Ven

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.