scsi: scsi_debug: Fix an error handling bug in sdeb_zbc_model_str()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 9 May 2020 10:04:08 +0000 (13:04 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 12 May 2020 03:21:27 +0000 (23:21 -0400)
commit47742bde281b2920aae8bb82ed2d61d890aa4f56
tree9af05f0472a29352874867d04776193fc24bb5db
parentd0dff2ac98dd41d7d451127d9eae2f6478fc40b0
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>
drivers/scsi/scsi_debug.c