Skip to content

Commit 79fc672

Browse files
Haoxiang Lidliviu
authored andcommitted
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: 5d51f6c ("drm/komeda: Add writeback support") Cc: stable@vger.kernel.org Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://lore.kernel.org/r/20241219090256.146424-1-haoxiang_li2024@163.com Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
1 parent fd39c41 commit 79fc672

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms,
160160
formats = komeda_get_layer_fourcc_list(&mdev->fmt_tbl,
161161
kwb_conn->wb_layer->layer_type,
162162
&n_formats);
163+
if (!formats) {
164+
kfree(kwb_conn);
165+
return -ENOMEM;
166+
}
163167

164168
err = drm_writeback_connector_init(&kms->base, wb_conn,
165169
&komeda_wb_connector_funcs,

0 commit comments

Comments
 (0)