From: Dan Carpenter <dan.carpenter@oracle.com>
To: Matthew Dharm <mdharm-usb@one-eyed-alien.net>,
Hannes Reinecke <hare@suse.de>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net,
linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org,
"Jörn Engel" <joern@purestorage.com>
Subject: [patch] usb: storage: debug: uninitialized var in usb_stor_show_sense()
Date: Sat, 29 Nov 2014 12:48:01 +0000 [thread overview]
Message-ID: <20141129124801.GA27251@mwanda> (raw)
The "fmt" variable might be used uninitialized, it should be set to NULL
at the start.
Fixes: d811b848ebb7 ('scsi: use sdev as argument for sense code printing')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/usb/storage/debug.c b/drivers/usb/storage/debug.c
index 57bf3ad..fd00509 100644
--- a/drivers/usb/storage/debug.c
+++ b/drivers/usb/storage/debug.c
@@ -164,7 +164,8 @@ void usb_stor_show_sense(const struct us_data *us,
unsigned char asc,
unsigned char ascq)
{
- const char *what, *keystr, *fmt;
+ const char *fmt = NULL;
+ const char *what, *keystr;
keystr = scsi_sense_key_string(key);
what = scsi_extd_sense_format(asc, ascq, &fmt);
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Matthew Dharm <mdharm-usb@one-eyed-alien.net>,
Hannes Reinecke <hare@suse.de>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net,
linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org,
"Jörn Engel" <joern@purestorage.com>
Subject: [patch] usb: storage: debug: uninitialized var in usb_stor_show_sense()
Date: Sat, 29 Nov 2014 15:48:01 +0300 [thread overview]
Message-ID: <20141129124801.GA27251@mwanda> (raw)
The "fmt" variable might be used uninitialized, it should be set to NULL
at the start.
Fixes: d811b848ebb7 ('scsi: use sdev as argument for sense code printing')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/usb/storage/debug.c b/drivers/usb/storage/debug.c
index 57bf3ad..fd00509 100644
--- a/drivers/usb/storage/debug.c
+++ b/drivers/usb/storage/debug.c
@@ -164,7 +164,8 @@ void usb_stor_show_sense(const struct us_data *us,
unsigned char asc,
unsigned char ascq)
{
- const char *what, *keystr, *fmt;
+ const char *fmt = NULL;
+ const char *what, *keystr;
keystr = scsi_sense_key_string(key);
what = scsi_extd_sense_format(asc, ascq, &fmt);
next reply other threads:[~2014-11-29 12:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-29 12:48 Dan Carpenter [this message]
2014-11-29 12:48 ` [patch] usb: storage: debug: uninitialized var in usb_stor_show_sense() Dan Carpenter
2014-11-29 16:07 ` James Bottomley
2014-11-29 16:07 ` James Bottomley
2014-12-01 10:42 ` Dan Carpenter
2014-12-01 10:42 ` Dan Carpenter
2014-12-02 11:07 ` [patch v2] scsi: set fmt to NULL scsi_extd_sense_format() by default Dan Carpenter
2014-12-02 11:07 ` Dan Carpenter
2014-12-02 14:50 ` James Bottomley
2014-12-02 14:50 ` James Bottomley
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=20141129124801.GA27251@mwanda \
--to=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=hare@suse.de \
--cc=joern@purestorage.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mdharm-usb@one-eyed-alien.net \
--cc=usb-storage@lists.one-eyed-alien.net \
/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.