summaryrefslogtreecommitdiff
path: root/drivers/accel/drm_accel.c
diff options
context:
space:
mode:
authorMike Christie <michael.christie@oracle.com>2023-11-06 17:13:04 -0600
committerMartin K. Petersen <martin.petersen@oracle.com>2023-11-08 21:46:58 -0500
commit3b83486399a6a9feb9c681b74c21a227d48d7020 (patch)
treeaef166e064a809e1bc0c18cdf6f8df52693e3df7 /drivers/accel/drm_accel.c
parent037fbd3fcfbd99145f9310d93f6637012807cfd0 (diff)
scsi: sd: Fix sshdr use in sd_suspend_common()
If scsi_execute_cmd() returns < 0, it doesn't initialize the sshdr, so we shouldn't access the sshdr. If it returns 0, then the cmd executed successfully, so there is no need to check the sshdr. sd_sync_cache() will only access the sshdr if it's been setup because it calls scsi_status_is_check_condition() before accessing it. However, the sd_sync_cache() caller, sd_suspend_common(), does not check. sd_suspend_common() is only checking for ILLEGAL_REQUEST which it's using to determine if the command is supported. If it's not it just ignores the error. So to fix its sshdr use this patch just moves that check to sd_sync_cache() where it converts ILLEGAL_REQUEST to success/0. sd_suspend_common() was ignoring that error and sd_shutdown() doesn't check for errors so there will be no behavior changes. Signed-off-by: Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20231106231304.5694-2-michael.christie@oracle.com Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/accel/drm_accel.c')
0 files changed, 0 insertions, 0 deletions