Skip to content
Commit b32283d7 authored by Harshit Mogalapalli's avatar Harshit Mogalapalli Committed by Martin K. Petersen
Browse files

scsi: scsi_debug: Fix missing error code in scsi_debug_init()

Smatch reports: drivers/scsi/scsi_debug.c:6996
	scsi_debug_init() warn: missing error code 'ret'

Although it is unlikely that KMEM_CACHE might fail, but if it does then ret
might be zero. So to fix this explicitly mark ret as "-ENOMEM" and then
goto driver_unreg.

Fixes: 1107c7b2

 ("scsi: scsi_debug: Dynamically allocate sdebug_queued_cmd")
Signed-off-by: default avatarHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Link: https://lore.kernel.org/r/20230406074607.3637097-1-harshit.m.mogalapalli@oracle.com
Reviewed-by: default avatarJohn Garry <john.g.garry@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e01e2290
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment