linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: "Matthew Dharm" <mdharm-usb@one-eyed-alien.net>,
	"Hannes Reinecke" <hare@suse.de>,
	"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: Re: [patch] usb: storage: debug: uninitialized var in usb_stor_show_sense()
Date: Mon, 1 Dec 2014 13:42:46 +0300	[thread overview]
Message-ID: <20141201104246.GD4994@mwanda> (raw)
In-Reply-To: <1417277275.2202.35.camel@HansenPartnership.com>

On Sat, Nov 29, 2014 at 08:07:55AM -0800, James Bottomley wrote:
> On Sat, 2014-11-29 at 15:48 +0300, Dan Carpenter wrote:
> > 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>
> 
> Hm, that' falls into the category of an interface that's hard to get
> right if every caller has to remember to set fmt to NULL.
> 
> Could you instead set *fmt to NULL in scsi_extd_sense_format()?  That
> way the interface is much easier.
> 

Sure.  I will send that tomorrow.

regards,
dan carpenter


  reply	other threads:[~2014-12-01 10:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=20141201104246.GD4994@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=James.Bottomley@HansenPartnership.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 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).