LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Colin King <colin.king@canonical.com>
Cc: Don Brace <don.brace@microsemi.com>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	esc.storagedev@microsemi.com, linux-scsi@vger.kernel.org,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] scsi: hpsa: fix an uninitialized read and dereference of pointer dev
Date: Thu, 23 May 2019 08:35:48 -0700	[thread overview]
Message-ID: <20190523153548.GA112363@archlinux-epyc> (raw)
In-Reply-To: <20190522083903.18849-1-colin.king@canonical.com>

On Wed, May 22, 2019 at 09:39:03AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently the check for a lockup_detected failure exits via the
> label return_reset_status that reads and dereferences an uninitialized
> pointer dev.  Fix this by ensuring dev is inintialized to null.
> 
> Addresses-Coverity: ("Uninitialized pointer read")
> Fixes: 14991a5bade5 ("scsi: hpsa: correct device resets")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

Clang similarly warns about this, hence my identical submission after
this, sorry for the noise.

> ---
>  drivers/scsi/hpsa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index c560a4532733..ac8338b0571b 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -5947,7 +5947,7 @@ static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
>  	int rc = SUCCESS;
>  	int i;
>  	struct ctlr_info *h;
> -	struct hpsa_scsi_dev_t *dev;
> +	struct hpsa_scsi_dev_t *dev = NULL;
>  	u8 reset_type;
>  	char msg[48];
>  	unsigned long flags;
> -- 
> 2.20.1
> 

  parent reply	other threads:[~2019-05-23 15:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22  8:39 Colin King
2019-05-23 15:25 ` Don.Brace
2019-05-23 15:35 ` Nathan Chancellor [this message]
2019-05-30  1:55 ` Martin K. Petersen

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=20190523153548.GA112363@archlinux-epyc \
    --to=natechancellor@gmail.com \
    --cc=colin.king@canonical.com \
    --cc=don.brace@microsemi.com \
    --cc=esc.storagedev@microsemi.com \
    --cc=jejb@linux.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --subject='Re: [PATCH][next] scsi: hpsa: fix an uninitialized read and dereference of pointer dev' \
    /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

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