"val" can never be less than zero here. It's unsigned and simple_strtoul() always returns positive values. I also cleaned up the check. "*cp != '\0'" is more explicit than "*cp" and I removed some parenthesis that weren't needed. Signed-off-by: Dan Carpenter <error27@xxxxxxxxx> diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 0681378..b108a9b 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -844,7 +844,7 @@ store_fc_rport_dev_loss_tmo(struct device *dev, struct device_attribute *attr, (rport->port_state == FC_PORTSTATE_NOTPRESENT)) return -EBUSY; val = simple_strtoul(buf, &cp, 0); - if ((*cp && (*cp != '\n')) || (val < 0)) + if (*cp != '\0' && *cp != '\n') return -EINVAL; /* -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html