scsi: qla4xxx: check return code of qla4xxx_copy_from_fwddb_param
authorYueHaibing <yuehaibing@huawei.com>
Thu, 20 Dec 2018 03:16:07 +0000 (11:16 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 9 Jan 2019 02:57:25 +0000 (21:57 -0500)
The return code should be check while qla4xxx_copy_from_fwddb_param fails.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Manish Rangankar <mrangankar@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla4xxx/ql4_os.c

index 949e186cc5d77ae9b51a563d4bb6fad884864cc6..1bc4db6e6d165200c7ed19b6815a95b2be527162 100644 (file)
@@ -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);