Commit b32283d
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: 1107c7b ("scsi: scsi_debug: Dynamically allocate sdebug_queued_cmd")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Link: https://lore.kernel.org/r/20230406074607.3637097-1-harshit.m.mogalapalli@oracle.com
Reviewed-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>1 parent e01e229 commit b32283d
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6992 | 6992 | | |
6993 | 6993 | | |
6994 | 6994 | | |
6995 | | - | |
| 6995 | + | |
| 6996 | + | |
6996 | 6997 | | |
| 6998 | + | |
6997 | 6999 | | |
6998 | 7000 | | |
6999 | 7001 | | |
| |||
0 commit comments