From: Tomi Valkeinen Date: Tue, 27 Aug 2013 11:11:48 +0000 (+0300) Subject: OMAPDSS: HDMI: Fix possible NULL reference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=db680c65156083c8780044f46f7a74544fcb3ce2;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git OMAPDSS: HDMI: Fix possible NULL reference Commit 5391e87d1259 (OMAPDSS: remove dispc's dependency to VENC/HDMI) introduced a possible NULL reference bug in the HDMI driver when setting timings. In practice the bug shouldn't happen, as the timings have been verified earlier, and thus the timings should always be ok. Fix the possible issue by moving the use of the timings pointer inside the NULL check. Signed-off-by: Tomi Valkeinen Reported-by: Dan Carpenter --- diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 44a885b92825..ea97854308f9 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -666,10 +666,11 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev, hdmi.ip_data.cfg.cm = cm; t = hdmi_get_timings(); - if (t != NULL) + if (t != NULL) { hdmi.ip_data.cfg = *t; - dispc_set_tv_pclk(t->timings.pixel_clock * 1000); + dispc_set_tv_pclk(t->timings.pixel_clock * 1000); + } mutex_unlock(&hdmi.lock); }