summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-05-09 13:04:08 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2020-05-11 23:21:27 -0400
commit47742bde281b2920aae8bb82ed2d61d890aa4f56 (patch)
tree9af05f0472a29352874867d04776193fc24bb5db /drivers/scsi/scsi_debug.c
parentd0dff2ac98dd41d7d451127d9eae2f6478fc40b0 (diff)
scsi: scsi_debug: Fix an error handling bug in sdeb_zbc_model_str()
This test is checking the wrong variable. It should be testing "res". The "sdeb_zbc_model" variable is an enum (unsigned in this situation) and we never assign negative values to it. [mkp: fixed commit desc issue reported by Doug] Link: https://lore.kernel.org/r/20200509100408.GA5555@mwanda Fixes: 9267e0eb41fe ("scsi: scsi_debug: Add ZBC module parameter") Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r--drivers/scsi/scsi_debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 105e563d87b4..73847366dc49 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -6460,7 +6460,7 @@ static int sdeb_zbc_model_str(const char *cp)
res = sysfs_match_string(zbc_model_strs_b, cp);
if (res < 0) {
res = sysfs_match_string(zbc_model_strs_c, cp);
- if (sdeb_zbc_model < 0)
+ if (res < 0)
return -EINVAL;
}
}