APPLIED: [PATCH][SRU][X] scsi_dh_alua: uninitialized variable in alua_rtpg()

Khaled Elmously khalid.elmously at canonical.com
Thu Feb 1 20:57:29 UTC 2018


Applied to Xenial

On 2017-11-29 17:19:41 , Dragan Stancevic wrote:
> From: Dan Carpenter <dan.carpenter at oracle.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1720228
> 
> It's possible to use "err" without initializing it.  If it happens to be
> a 2 which is SCSI_DH_RETRY then that could cause a bug.  Bart Van Assche
> pointed out that we should probably re-initialize it for every iteration
> through the retry loop.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
> Reviewed-by: Hannes Reinicke <hare at suse.de>
> Signed-off-by: Martin K. Petersen <martin.petersen at oracle.com>
> Signed-off-by: James Bottomley <jejb at linux.vnet.ibm.com>
> (cherry picked from commit a4bd85203190990ad808abbd4a5dc848a950002c)
> Signed-off-by: Dragan Stancevic <dragan.stancevic at canonical.com>
> ---
>  drivers/scsi/device_handler/scsi_dh_alua.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c
> b/drivers/scsi/device_handler/scsi_dh_alua.c
> index 8eaed05..a655cf2 100644
> --- a/drivers/scsi/device_handler/scsi_dh_alua.c
> +++ b/drivers/scsi/device_handler/scsi_dh_alua.c
> @@ -532,6 +532,7 @@ static int alua_rtpg(struct scsi_device *sdev,
> struct alua_port_group *pg)
>                 return SCSI_DH_DEV_TEMP_BUSY;
> 
>   retry:
> +       err = 0;
>         retval = submit_rtpg(sdev, buff, bufflen, &sense_hdr, pg->flags);
> 
>         if (retval) {
> -- 
> 2.7.4
> 
> -- 
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team




More information about the kernel-team mailing list