mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: sr: fix typo in CDROM(CLOSETRAY|EJECT) handling
@ 2022-03-23  0:22 Kevin Groeneveld
  2022-03-23  6:36 ` Christoph Hellwig
  2022-03-30  3:38 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Kevin Groeneveld @ 2022-03-23  0:22 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen, linux-scsi, linux-kernel
  Cc: Kevin Groeneveld

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.

Fixes: 2e27f576abc6 ("scsi: scsi_ioctl: Call scsi_cmd_ioctl() from scsi_ioctl()")
Signed-off-by: Kevin Groeneveld <kgroeneveld@lenbrook.com>
---
 drivers/scsi/sr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index f925b1f1f9ad..a0beb11abdc9 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -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;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-30  3:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-23  0:22 [PATCH] scsi: sr: fix typo in CDROM(CLOSETRAY|EJECT) handling Kevin Groeneveld
2022-03-23  6:36 ` Christoph Hellwig
2022-03-30  3:38 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®