aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_ioctl.c
diff options
context:
space:
mode:
authorMartin K. Petersen <[email protected]>2021-06-02 05:33:12 +0000
committerMartin K. Petersen <[email protected]>2021-06-02 05:37:04 +0000
commit1ff28f229bc7fe36735684b25e63b528dbb962a5 (patch)
tree2c1371434da0e190d8dfdb7709b41b643ce5635e /drivers/scsi/scsi_ioctl.c
parentscsi: qedi: Wake up if cmd_cleanup_req is set (diff)
parentscsi: core: Drop obsolete Linux-specific SCSI status codes (diff)
downloadkernel-1ff28f229bc7fe36735684b25e63b528dbb962a5.tar.gz
kernel-1ff28f229bc7fe36735684b25e63b528dbb962a5.zip
Merge branch '5.14/scsi-result' into 5.14/scsi-staging
Include Hannes' SCSI command result rework in the staging branch. [mkp: remove DRIVER_SENSE from mpi3mr] Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'drivers/scsi/scsi_ioctl.c')
-rw-r--r--drivers/scsi/scsi_ioctl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index 14872c9dc78c..0d13610cd6bf 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -101,8 +101,9 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,
SCSI_LOG_IOCTL(2, sdev_printk(KERN_INFO, sdev,
"Ioctl returned 0x%x\n", result));
- if (driver_byte(result) == DRIVER_SENSE &&
- scsi_sense_valid(&sshdr)) {
+ if (result < 0)
+ goto out;
+ if (scsi_sense_valid(&sshdr)) {
switch (sshdr.sense_key) {
case ILLEGAL_REQUEST:
if (cmd[0] == ALLOW_MEDIUM_REMOVAL)
@@ -133,7 +134,7 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,
break;
}
}
-
+out:
SCSI_LOG_IOCTL(2, sdev_printk(KERN_INFO, sdev,
"IOCTL Releasing command\n"));
return result;