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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Dragan Stancevic
From: Dan Carpenter <[hidden email]>

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 <[hidden email]>
Reviewed-by: Hannes Reinicke <[hidden email]>
Signed-off-by: Martin K. Petersen <[hidden email]>
Signed-off-by: James Bottomley <[hidden email]>
(cherry picked from commit a4bd85203190990ad808abbd4a5dc848a950002c)
Signed-off-by: Dragan Stancevic <[hidden email]>
---
 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
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

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

Colin King
On 29/11/17 23:19, Dragan Stancevic wrote:

> From: Dan Carpenter <[hidden email]>
>
> 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 <[hidden email]>
> Reviewed-by: Hannes Reinicke <[hidden email]>
> Signed-off-by: Martin K. Petersen <[hidden email]>
> Signed-off-by: James Bottomley <[hidden email]>
> (cherry picked from commit a4bd85203190990ad808abbd4a5dc848a950002c)
> Signed-off-by: Dragan Stancevic <[hidden email]>
> ---
>  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) {
>
Clean upstream cherry pick, looks good.

Acked-by: Colin Ian King <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

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

Dragan Stancevic
Has this gone in? I just did a git pull but don't see it in the tree.

I'm asking because I have a user that has been waiting on this for a
few months. If it hasn't can someone else also take a look at it so it
can move forward?

Thank you in advance

On Thu, Nov 30, 2017 at 7:43 AM, Colin Ian King
<[hidden email]> wrote:

> On 29/11/17 23:19, Dragan Stancevic wrote:
>> From: Dan Carpenter <[hidden email]>
>>
>> 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 <[hidden email]>
>> Reviewed-by: Hannes Reinicke <[hidden email]>
>> Signed-off-by: Martin K. Petersen <[hidden email]>
>> Signed-off-by: James Bottomley <[hidden email]>
>> (cherry picked from commit a4bd85203190990ad808abbd4a5dc848a950002c)
>> Signed-off-by: Dragan Stancevic <[hidden email]>
>> ---
>>  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) {
>>
> Clean upstream cherry pick, looks good.
>
> Acked-by: Colin Ian King <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team