[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191027203352.994952769@linuxfoundation.org>
Date: Sun, 27 Oct 2019 21:59:02 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Navid Emamdoost <navid.emamdoost@...il.com>,
"James Qian Wang (Arm Technology China)" <james.qian.wang@....com>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.3 024/197] drm/komeda: prevent memory leak in komeda_wb_connector_add
From: Navid Emamdoost <navid.emamdoost@...il.com>
[ Upstream commit a0ecd6fdbf5d648123a7315c695fb6850d702835 ]
In komeda_wb_connector_add if drm_writeback_connector_init fails the
allocated memory for kwb_conn should be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@....com>
Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@....com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190925043031.32308-1-navid.emamdoost@gmail.com
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
index 23fbee268119f..b72840c06ab76 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
@@ -165,8 +165,10 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms,
&komeda_wb_encoder_helper_funcs,
formats, n_formats);
komeda_put_fourcc_list(formats);
- if (err)
+ if (err) {
+ kfree(kwb_conn);
return err;
+ }
drm_connector_helper_add(&wb_conn->base, &komeda_wb_conn_helper_funcs);
--
2.20.1
Powered by blists - more mailing lists