]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
[SCSI] scsi_host_lookup: error returns and NULL pointers
authorJames Smart <James.Smart@Emulex.Com>
Fri, 8 Aug 2008 00:49:30 +0000 (20:49 -0400)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 3 Oct 2008 16:46:12 +0000 (11:46 -0500)
commit315cb0ad124575e75da2d0e0a95990587fc23485
tree1efbc6b9b744163bb542ea3eec87bdb4786b598a
parent6f92a6a7ddba5ae7ca0f0255d46410465dcf2ba6
[SCSI] scsi_host_lookup: error returns and NULL pointers

This patch cleans up the behavior of scsi_host_lookup().

The original implementation attempted to use the dual role of
either returning a pointer value, or a negative error code.
User's needed to use IS_ERR() to check the result. Additionally,
the IS_ERR() macro never checks for when a NULL pointer was
returned, so a NULL pointer actually passes with a success case.
Note: scsi_host_get(), used by scsi_host_lookup(), can return
a NULL pointer.

Talk about a mudhole for the unitiated to step into....

This patch converts scsi_host_lookup() to return either NULL
or a valid pointer. The consumers were updated for the change.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/hosts.c
drivers/scsi/scsi_proc.c
drivers/scsi/scsi_tgt_lib.c
drivers/scsi/scsi_transport_iscsi.c