[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3179555.Y0kaXrZstW@wuerfel>
Date: Tue, 22 Nov 2016 15:49:50 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Hannes Reinecke <hare@...e.com>
Cc: "Martin K. Petersen" <martin.petersen@...cle.com>,
Don Brace <don.brace@...rosemi.com>,
"James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
Kevin Barnett <kevin.barnett@...rosemi.com>,
Scott Teel <scott.teel@...rosemi.com>,
Justin Lindley <justin.lindley@...rosemi.com>,
esc.storagedev@...rosemi.com, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: hpsa: fix uninitialized variable access
On Tuesday, November 22, 2016 3:47:09 PM CET Hannes Reinecke wrote:
> index 05f7782..ee6f852 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -2031,7 +2031,7 @@ static struct hpsa_scsi_dev_t
> *lookup_hpsa_scsi_dev(struct ctlr_info *h,
>
> static int hpsa_slave_alloc(struct scsi_device *sdev)
> {
> - struct hpsa_scsi_dev_t *sd;
> + struct hpsa_scsi_dev_t *sd = NULL;
> unsigned long flags;
> struct ctlr_info *h;
>
>
I try not to add initializations like this in general, since they
prevent us from finding the bug, but here that seems fine too
as we immediately test it for NULL anyway.
Can you follow up with a patch to do that?
Arnd
Powered by blists - more mailing lists