mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-11 20:05:22 +02:00
drm: vc4: Fix possible null pointer dereference
[ Upstream commitc534b63bed
] In vc4_hdmi_audio_init() of_get_address() may return NULL which is later dereferenced. Fix this bug by adding NULL check. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes:bb7d785688
("drm/vc4: Add HDMI audio support") Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru> Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240409075622.11783-1-amishin@t-argos.ru Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
335cc45ef2
commit
42c22b6305
|
@ -2729,6 +2729,8 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi)
|
|||
index = 1;
|
||||
|
||||
addr = of_get_address(dev->of_node, index, NULL, NULL);
|
||||
if (!addr)
|
||||
return -EINVAL;
|
||||
|
||||
vc4_hdmi->audio.dma_data.addr = be32_to_cpup(addr) + mai_data->offset;
|
||||
vc4_hdmi->audio.dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
|
||||
|
|
Loading…
Reference in New Issue
Block a user