From 3573fb8288eccfec74d9da89df7284ac52ba834e Mon Sep 17 00:00:00 2001 From: "jian.cao" Date: Fri, 27 Aug 2021 14:21:43 +0800 Subject: [PATCH] osd: avoid color_info NULL [1/1] PD#SWPL-57980 Problem: after the device is powered on plug in the HDMI cable a few seconds then OSD panic Solution: avoid color_info NULL Verify: g12a Change-Id: I69202bc06d889e59a391b50b609237689eb29d31 Signed-off-by: jian.cao --- drivers/amlogic/media/osd/osd_hw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/amlogic/media/osd/osd_hw.c b/drivers/amlogic/media/osd/osd_hw.c index e1d73ef6f269..88c0ceb2bcff 100644 --- a/drivers/amlogic/media/osd/osd_hw.c +++ b/drivers/amlogic/media/osd/osd_hw.c @@ -9161,10 +9161,13 @@ static int osd_setting_order(u32 output_index) for (i = 0; i < osd_count; i++) { if (osd_hw.enable[i]) { struct hw_osd_reg_s *osd_reg = &hw_osd_reg_array[i]; - enum color_index_e idx = - osd_hw.color_info[i]->color_index; + enum color_index_e idx = COLOR_INDEX_32_BGRX; bool rgbx = false; + if (osd_hw.color_info[i]) + idx = osd_hw.color_info[i]->color_index; + else + osd_log_err("osd%d color_info is NULL\n", i); /* update = is_freescale_para_changed(i); */ if (!osd_hw.osd_afbcd[i].enable) canvas_config(osd_hw.fb_gem[i].canvas_idx, -- 2.20.1