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: [email protected] Signed-off-by: Haoxiang Li <[email protected]> Acked-by: Liviu Dudau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Liviu Dudau <[email protected]>
1 parent fd39c41 commit 79fc672

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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)