diff mbox series

[6/7] qla2xxx: Make sure that qlafx00_ioctl_iosb_entry() initializes 'res'

Message ID 20181018224546.189268-7-bvanassche@acm.org (mailing list archive)
State Accepted
Headers show
Series qla2xxx patches for kernel v4.20 | expand

Commit Message

Bart Van Assche Oct. 18, 2018, 10:45 p.m. UTC
Only one of the two code paths in qlafx00_ioctl_iosb_entry() initializes
the variable 'res'. Make sure that 'res' is initialized before
sp->done(sp, res) is called.

Cc: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/qla2xxx/qla_mr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Madhani, Himanshu Oct. 30, 2018, 4:56 a.m. UTC | #1
> On Oct 18, 2018, at 3:45 PM, Bart Van Assche <bvanassche@acm.org> wrote:
> 
> External Email
> 
> Only one of the two code paths in qlafx00_ioctl_iosb_entry() initializes
> the variable 'res'. Make sure that 'res' is initialized before
> sp->done(sp, res) is called.
> 
> Cc: Himanshu Madhani <himanshu.madhani@cavium.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
> drivers/scsi/qla2xxx/qla_mr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c
> index 2d96f3b7e3e3..b8f967e61891 100644
> --- a/drivers/scsi/qla2xxx/qla_mr.c
> +++ b/drivers/scsi/qla2xxx/qla_mr.c
> @@ -2212,7 +2212,7 @@ qlafx00_ioctl_iosb_entry(scsi_qla_host_t *vha, struct req_que *req,
>        struct bsg_job *bsg_job;
>        struct fc_bsg_reply *bsg_reply;
>        struct srb_iocb *iocb_job;
> -       int res;
> +       int res = 0;
>        struct qla_mt_iocb_rsp_fx00 fstatus;
>        uint8_t *fw_sts_ptr;
> 
> --
> 2.19.1.568.g152ad8e336-goog
> 

Looks good. 

Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com> 

Thanks,
- Himanshu
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c
index 2d96f3b7e3e3..b8f967e61891 100644
--- a/drivers/scsi/qla2xxx/qla_mr.c
+++ b/drivers/scsi/qla2xxx/qla_mr.c
@@ -2212,7 +2212,7 @@  qlafx00_ioctl_iosb_entry(scsi_qla_host_t *vha, struct req_que *req,
 	struct bsg_job *bsg_job;
 	struct fc_bsg_reply *bsg_reply;
 	struct srb_iocb *iocb_job;
-	int res;
+	int res = 0;
 	struct qla_mt_iocb_rsp_fx00 fstatus;
 	uint8_t	*fw_sts_ptr;