Skip to contentSkip to conversation

scsi: remove unnecessary check in drivers/scsi/sg.c

PATCH In review [email protected] 1 participant 1 message Mar 6, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/29 scsi: remove unnecessary check in drivers/scsi/sg.c

From: Eric Sesterhenn <[email protected]>

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.

---

 drivers/scsi/sg.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/sg.c renamed from drivers/scsi/sg.c~remove-unnecessary-check-in-drivers-scsi-sgc +1 -1
diff -puN drivers/scsi/sg.c~remove-unnecessary-check-in-drivers-scsi-sgc drivers/scsi/sg.c
@@ -1837,7 +1837,7 @@ sg_build_indirect(Sg_scatter_hold * schp
 	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 */

_