linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] usb: storage: debug: uninitialized var in usb_stor_show_sense()
@ 2014-11-29 12:48 Dan Carpenter
  2014-11-29 16:07 ` James Bottomley
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2014-11-29 12:48 UTC (permalink / raw)
  To: Matthew Dharm, Hannes Reinecke
  Cc: Greg Kroah-Hartman, linux-usb, usb-storage, linux-scsi,
	kernel-janitors, Jörn Engel

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);

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

end of thread, other threads:[~2014-12-02 14:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-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 14:50     ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).