From db187fc60479e75fed022e8cec1e87b5c7e39eb5 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 15 May 2021 22:52:16 +0000 Subject: [PATCH] qla2x00t-32gbit: 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 Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen [ commit 5dc3468888f8ba54c3a2fdd38b13288f6b8daed2 upstream ] git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9414 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t-32gbit/qla_bsg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qla2x00t-32gbit/qla_bsg.c b/qla2x00t-32gbit/qla_bsg.c index 78cd590a6..aa991c86c 100644 --- a/qla2x00t-32gbit/qla_bsg.c +++ b/qla2x00t-32gbit/qla_bsg.c @@ -2727,8 +2727,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,