From: Eric Sesterhenn Date: Wed, 23 May 2007 21:41:36 +0000 (-0700) Subject: [SCSI] sg: remove unnecessary check X-Git-Tag: v2.6.23-rc1~1053^2~116 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb119935e11b98230f20c500e9f9125ddf0f3a4d;p=linux-2.6 [SCSI] sg: remove unnecessary check coverity spotted this (cid #758). All callers dereference sfp, so we dont need this check. In addition to this, we dereference it earlier in the function. Signed-off-by: Eric Sesterhenn Acked-by: Douglas Gilbert Signed-off-by: Andrew Morton Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 0c691a60a7..85d38940a6 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1842,7 +1842,7 @@ sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size) int blk_size = buff_size; struct page *p = NULL; - if ((blk_size < 0) || (!sfp)) + if (blk_size < 0) return -EFAULT; if (0 == blk_size) ++blk_size; /* don't know why */