[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210301161214.384786977@linuxfoundation.org>
Date: Mon, 1 Mar 2021 17:07:06 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Yongqiang Niu <yongqiang.niu@...iatek.com>,
Chun-Kuang Hu <chunkuang.hu@...nel.org>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.11 258/775] drm/mediatek: Check if fb is null
From: Yongqiang Niu <yongqiang.niu@...iatek.com>
[ Upstream commit b1d685b6467ac0d98fc63989f71b4ca9186be5d4 ]
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@...iatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
index 74ef6fc0528b6..523716e3c278a 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
@@ -267,7 +267,7 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, 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) {
--
2.27.0
Powered by blists - more mailing lists