[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20241211025712.824391-1-haoxiang_li2024@163.com>
Date: Wed, 11 Dec 2024 10:57:12 +0800
From: Haoxiang Li <haoxiang_li2024@....com>
To: liviu.dudau@....com,
maarten.lankhorst@...ux.intel.com,
mripard@...nel.org,
tzimmermann@...e.de,
airlied@...il.com,
simona@...ll.ch,
ayan.halder@....com,
james.qian.wang@....com
Cc: dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org,
Haoxiang Li <haoxiang_li2024@....com>,
stable@...r.kernel.org
Subject: [PATCH] drm/komeda: Add check for komeda_get_layer_fourcc_list()
Add check for the return value of komeda_get_layer_fourcc_list()
to catch the potential exception.
Fixes: 5d51f6c0da1b ("drm/komeda: Add writeback support")
Cc: stable@...r.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@....com>
---
drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c | 4 ++++
1 file changed, 4 insertions(+)
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 ebccb74306a7..f30b3d5eeca5 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
@@ -160,6 +160,10 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms,
formats = komeda_get_layer_fourcc_list(&mdev->fmt_tbl,
kwb_conn->wb_layer->layer_type,
&n_formats);
+ if (!formats) {
+ kfree(kwb_conn);
+ return -ENOMEM;
+ }
err = drm_writeback_connector_init(&kms->base, wb_conn,
&komeda_wb_connector_funcs,
--
2.25.1
Powered by blists - more mailing lists