From: Oliver Neukum <oneukum@suse.de>
To: "James E.J. Bottomley" <James.Bottomley@suse.de>,
hare@suse.de, linux-scsi@vger.kernel.org
Subject: [PATCH 1/3] USB: sd: sd_start_stop_device proper error codes
Date: Fri, 5 Nov 2010 11:09:12 +0100 [thread overview]
Message-ID: <201011051109.12410.oneukum@suse.de> (raw)
>From 8497ed3a68f19cfc8246c88716a5224cf24947b5 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oliver@neukum.org>
Date: Mon, 25 Oct 2010 11:45:59 +0200
Subject: [PATCH 1/3] USB: sd: sd_start_stop_device proper error codes
sd_start_stop_device leaks SCSI specific error codes
to the generic driver code
Signed-off-by: Oliver Neukum <oneukum@suse.de>
---
drivers/scsi/sd.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index b9ab3a5..fcba7d2 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2551,7 +2551,11 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start)
sd_print_sense_hdr(sdkp, &sshdr);
}
- return res;
+ /* SCSI error codes must not go to the generic layer */
+ if (res)
+ return -EIO;
+
+ return 0;
}
/*
--
1.7.1
reply other threads:[~2010-11-05 10:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201011051109.12410.oneukum@suse.de \
--to=oneukum@suse.de \
--cc=James.Bottomley@suse.de \
--cc=hare@suse.de \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox