scsi: sr: fix typo in CDROM(CLOSETRAY|EJECT) handling
PATCH 1/1 scsi: sr: fix typo in CDROM(CLOSETRAY|EJECT) handling
Commit 2e27f576abc6 ("scsi: scsi_ioctl: Call scsi_cmd_ioctl() from scsi_ioctl()") seems to have a typo as it is checking ret instead of cmd in the if statement checking for CDROMCLOSETRAY and CDROMEJECT. This changes the behaviour of these ioctls as the cdrom_ioctl handling of these is more restrictive than the scsi_ioctl version.
--- drivers/scsi/sr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/sr.c +1 -1
@@ -578,7 +578,7 @@ static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,scsi_autopm_get_device (sdev); -if (ret !=CDROMCLOSETRAY && ret !=CDROMEJECT ) { +if (cmd !=CDROMCLOSETRAY && cmd !=CDROMEJECT ) { ret =cdrom_ioctl (&cd->cdi, bdev, mode, cmd, arg);if (ret != -ENOSYS ) goto put;
Signature · 1 line
2.17.1
Looks good:
Martin K. Petersen
AppliedKevin,
Quoted 5 lines
Commit
2e27f576abc6("scsi:scsi_ioctl: Callscsi_cmd_ioctl()fromscsi_ioctl()") seems to have a typo as it is checking ret instead of cmd in the if statement checking for CDROMCLOSETRAY and CDROMEJECT. This changes the behaviour of these ioctls as thecdrom_ioctlhandling of these is more restrictive than thescsi_ioctlversion.
Applied to 5.18/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 8 lines · Kevin Groeneveld
Commit
2e27f576abc6("scsi:scsi_ioctl: Callscsi_cmd_ioctl()fromscsi_ioctl()") seems to have a typo as it is checking ret instead of cmd in the if statement checking for CDROMCLOSETRAY and CDROMEJECT. This changes the behaviour of these ioctls as thecdrom_ioctlhandling of these is more restrictive than thescsi_ioctlversion.[...]
Applied to 5.18/scsi-fixes, thanks!
[1/1] scsi: sr: fix typo in CDROM(CLOSETRAY|EJECT) handling
https://git.kernel.org/mkp/scsi/c/bc5519c18a32
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering