From: jian.cao Date: Fri, 27 Aug 2021 06:21:43 +0000 (+0800) Subject: osd: avoid color_info NULL [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3573fb8288eccfec74d9da89df7284ac52ba834e;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 --- 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,