Skip to content

Commit

Permalink
drm/mediatek: Check if fb is null
Browse files Browse the repository at this point in the history
It's possible that state->base.fb is null. Add a check before access its
format.

Fixes: b6b1bb9 ("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>
  • Loading branch information
Yongqiang Niu authored and Chun-Kuang Hu committed Feb 4, 2021
1 parent 5b9576e commit b1d685b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/mediatek/mtk_disp_ovl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b1d685b

Please sign in to comment.