diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2021-04-11 11:21:40 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-04-13 00:38:58 -0400 |
commit | 5dc3468888f8ba54c3a2fdd38b13288f6b8daed2 (patch) | |
tree | 0e831e5c9143dc261ab4f82c95f63f19945c083a /drivers/scsi/qla2xxx | |
parent | efd2617100d9c6a49c8cd27160a2353b04844d78 (diff) | |
download | linux-stable-5dc3468888f8ba54c3a2fdd38b13288f6b8daed2.tar.gz linux-stable-5dc3468888f8ba54c3a2fdd38b13288f6b8daed2.tar.bz2 linux-stable-5dc3468888f8ba54c3a2fdd38b13288f6b8daed2.zip |
scsi: qla2xxx: Reuse existing error handling path
There is no need to duplicate code, use the existing error handling path to
free resources. This is more future-proof.
Link: https://lore.kernel.org/r/6973844a1532ec2dc8e86f3533362e79d78ed774.1618132821.git.christophe.jaillet@wanadoo.fr
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_bsg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index aef2f7cc89d3..d42b2ad84049 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c @@ -2585,8 +2585,8 @@ qla2x00_get_host_stats(struct bsg_job *bsg_job) data = kzalloc(response_len, GFP_KERNEL); if (!data) { - kfree(req_data); - return -ENOMEM; + ret = -ENOMEM; + goto host_stat_out; } ret = qla2xxx_get_ini_stats(fc_bsg_to_shost(bsg_job), req_data->stat_type, |