diff mbox series

[-next] scsi: qla4xxx: check return code of qla4xxx_copy_from_fwddb_param

Message ID 20181220031607.10588-1-yuehaibing@huawei.com (mailing list archive)
State Mainlined
Commit 72b4a0465f995175a2e22cf4a636bf781f1f28a7
Headers show
Series [-next] scsi: qla4xxx: check return code of qla4xxx_copy_from_fwddb_param | expand

Commit Message

Yue Haibing Dec. 20, 2018, 3:16 a.m. UTC
The return code should be check while qla4xxx_copy_from_fwddb_param
fails.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/scsi/qla4xxx/ql4_os.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Manish Rangankar Dec. 24, 2018, 8:49 a.m. UTC | #1
> -----Original Message-----
> From: YueHaibing <yuehaibing@huawei.com>
> Sent: Thursday, December 20, 2018 8:46 AM
> To: QLogic-Storage-Upstream@qlogic.com; jejb@linux.ibm.com;
> martin.petersen@oracle.com
> Cc: linux-kernel@vger.kernel.org; linux-scsi@vger.kernel.org; YueHaibing
> <yuehaibing@huawei.com>
> Subject: [EXT] [PATCH -next] scsi: qla4xxx: check return code of
> qla4xxx_copy_from_fwddb_param
> 
> External Email
> 
> ----------------------------------------------------------------------
> External Email
> 
> The return code should be check while qla4xxx_copy_from_fwddb_param fails.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/scsi/qla4xxx/ql4_os.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index
> 949e186..1bc4db6 100644
> --- a/drivers/scsi/qla4xxx/ql4_os.c
> +++ b/drivers/scsi/qla4xxx/ql4_os.c
> @@ -7232,6 +7232,8 @@ static int qla4xxx_sysfs_ddb_tgt_create(struct
> scsi_qla_host *ha,
> 
>         rc = qla4xxx_copy_from_fwddb_param(fnode_sess, fnode_conn,
>                                            fw_ddb_entry);
> +       if (rc)
> +               goto free_sess;
> 
>         ql4_printk(KERN_INFO, ha, "%s: sysfs entry %s created\n",
>                    __func__, fnode_sess->dev.kobj.name);
> --
> 2.7.0
> 

Thanks
Acked-by: Manish Rangankar <mrangankar@marvell.com>
Martin K. Petersen Jan. 4, 2019, 6:04 a.m. UTC | #2
YueHaibing,

> The return code should be check while qla4xxx_copy_from_fwddb_param
> fails.

Applied to 4.21/scsi-fixes, thank you.
diff mbox series

Patch

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 949e186..1bc4db6 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -7232,6 +7232,8 @@  static int qla4xxx_sysfs_ddb_tgt_create(struct scsi_qla_host *ha,
 
 	rc = qla4xxx_copy_from_fwddb_param(fnode_sess, fnode_conn,
 					   fw_ddb_entry);
+	if (rc)
+		goto free_sess;
 
 	ql4_printk(KERN_INFO, ha, "%s: sysfs entry %s created\n",
 		   __func__, fnode_sess->dev.kobj.name);