From: Eric Sesterhenn Date: Wed, 23 May 2007 21:41:36 +0000 (-0700) Subject: [SCSI] sg: remove unnecessary check X-Git-Tag: MMI-PSA29.97-13-9~42242^2~116 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fb119935e11b98230f20c500e9f9125ddf0f3a4d;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [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 0c691a60a756..85d38940a6c9 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 */