drm/msm/sde: fix null parameter checks in drm driver
This change adds null parameter checks prior to dereferencing
them in drm driver.
Change-Id: I0354924948bead8a4f7fa8e1201f01cecda510cb
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
diff --git a/drivers/gpu/drm/msm/sde/sde_plane.c b/drivers/gpu/drm/msm/sde/sde_plane.c
index 2a98af4..246e401 100644
--- a/drivers/gpu/drm/msm/sde/sde_plane.c
+++ b/drivers/gpu/drm/msm/sde/sde_plane.c
@@ -367,7 +367,7 @@
total_fl = _sde_plane_calc_fill_level(plane, fmt,
psde->pipe_cfg.src_rect.w);
- if (SDE_FORMAT_IS_LINEAR(fmt))
+ if (fmt && SDE_FORMAT_IS_LINEAR(fmt))
lut_usage = SDE_QOS_LUT_USAGE_LINEAR;
else
lut_usage = SDE_QOS_LUT_USAGE_MACROTILE;
@@ -428,7 +428,7 @@
fb->modifier,
drm_format_num_planes(fb->pixel_format));
- if (SDE_FORMAT_IS_LINEAR(fmt)) {
+ if (fmt && SDE_FORMAT_IS_LINEAR(fmt)) {
danger_lut = psde->catalog->perf.danger_lut_tbl
[SDE_QOS_LUT_USAGE_LINEAR];
safe_lut = psde->catalog->perf.safe_lut_tbl