From: Boaz Harrosh <bharrosh@panasas.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] Fix uninitialized variable error in scsi_io_completion
Date: Mon, 15 Dec 2008 17:46:03 +0200 [thread overview]
Message-ID: <49467BBB.4070002@panasas.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0812151026100.2525-100000@iolanthe.rowland.org>
Alan Stern wrote:
> This patch (as1191) adds a missing "default" case in
> scsi_io_completion(), thereby fixing an "uninitialized variable"
> error. It also adds a missing newline to a log entry.
>
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
>
> ---
>
> James, I'm shocked! :-) Didn't you ever try to compile your changes
> to this routine?
>
> Alan Stern
>
>
>
> Index: usb-2.6/drivers/scsi/scsi_lib.c
> ===================================================================
> --- usb-2.6.orig/drivers/scsi/scsi_lib.c
> +++ usb-2.6/drivers/scsi/scsi_lib.c
> @@ -1024,6 +1024,10 @@ void scsi_io_completion(struct scsi_cmnd
> case 0x09: /* self test in progress */
> action = ACTION_DELAYED_RETRY;
> break;
> + default:
> + description = "Device not ready";
> + action = ACTION_FAIL;
> + break;
> }
> } else {
> description = "Device not ready";
> @@ -1049,7 +1053,7 @@ void scsi_io_completion(struct scsi_cmnd
> /* Give up and fail the remainder of the request */
> if (!(req->cmd_flags & REQ_QUIET)) {
> if (description)
> - scmd_printk(KERN_INFO, cmd, "%s",
> + scmd_printk(KERN_INFO, cmd, "%s\n",
> description);
> scsi_print_result(cmd);
> if (driver_byte(result) & DRIVER_SENSE)
>
> --
Good catch, I saw the warning but failed to see the missing case.
I attributed it to my brain dead gcc version.
Boaz
prev parent reply other threads:[~2008-12-15 15:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-15 15:31 [PATCH] Fix uninitialized variable error in scsi_io_completion Alan Stern
2008-12-15 15:46 ` Boaz Harrosh [this message]
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=49467BBB.4070002@panasas.com \
--to=bharrosh@panasas.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.