summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
diff options
context:
space:
mode:
authorYongqiang Niu <yongqiang.niu@mediatek.com>2021-01-11 15:43:44 +0800
committerChun-Kuang Hu <chunkuang.hu@kernel.org>2021-02-04 22:52:55 +0800
commitb1d685b6467ac0d98fc63989f71b4ca9186be5d4 (patch)
treeacdf235b465c192691e35c8763073b8cfc9803b8 /drivers/gpu/drm/mediatek/mtk_disp_ovl.c
parent5b9576e202e174ccd099e16b9e9367036247edb8 (diff)
drm/mediatek: Check if fb is null
It's possible that state->base.fb is null. Add a check before access its format. Fixes: b6b1bb980ec4 ("drm/mediatek: Turn off Alpha bit when plane format has no alpha") Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com> Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/mediatek/mtk_disp_ovl.c')
-rw-r--r--drivers/gpu/drm/mediatek/mtk_disp_ovl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
index 266c5c5ca280..1c295c58a5e8 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
@@ -291,7 +291,7 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx,
}
con = ovl_fmt_convert(ovl, fmt);
- if (state->base.fb->format->has_alpha)
+ if (state->base.fb && state->base.fb->format->has_alpha)
con |= OVL_CON_AEN | OVL_CON_ALPHA;
if (pending->rotation & DRM_MODE_REFLECT_Y) {