diff options
author | John Garry <john.g.garry@oracle.com> | 2023-03-13 09:31:06 +0000 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-03-16 23:25:36 -0400 |
commit | 06be9fbebb1beb6a885c95fbe3bb2f05f3463a70 (patch) | |
tree | 56f03d4da70228acb61be9c582bbeacadfd120b4 /drivers/scsi/scsi_debug.c | |
parent | d280a4ef229c0def06f6641183fb92100b410c63 (diff) | |
download | lwn-06be9fbebb1beb6a885c95fbe3bb2f05f3463a70.tar.gz lwn-06be9fbebb1beb6a885c95fbe3bb2f05f3463a70.zip |
scsi: scsi_debug: Drop scsi_debug_abort() NULL pointer checks
The SCSI cmnd pointer arg would never be NULL, so drop the check. In
addition, its SCSI device pointer would never be NULL.
The only caller is scsi_send_eh_cmnd() -> scsi_abort_eh_cmnd() ->
scsi_try_to_abort_cmd() -> scsi_try_to_abort_cmd(), and in the origin of
that chain those pointers cannot be NULL.
Signed-off-by: John Garry <john.g.garry@oracle.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Link: https://lore.kernel.org/r/20230313093114.1498305-4-john.g.garry@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.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 883c587c815a..083d08e34162 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -5360,13 +5360,13 @@ static int scsi_debug_abort(struct scsi_cmnd *SCpnt) bool ok; ++num_aborts; - if (SCpnt) { - ok = stop_queued_cmnd(SCpnt); - if (SCpnt->device && (SDEBUG_OPT_ALL_NOISE & sdebug_opts)) - sdev_printk(KERN_INFO, SCpnt->device, - "%s: command%s found\n", __func__, - ok ? "" : " not"); - } + + ok = stop_queued_cmnd(SCpnt); + if (SDEBUG_OPT_ALL_NOISE & sdebug_opts) + sdev_printk(KERN_INFO, SCpnt->device, + "%s: command%s found\n", __func__, + ok ? "" : " not"); + return SUCCESS; } |