media: platform: mediatek: vpu: fix NULL ptr dereference
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 24 May 2023 12:11:47 +0000 (13:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Aug 2023 15:52:23 +0000 (17:52 +0200)
commitb7bd48f0be84e24d21aa3a8f59a8a9cb8633a1c4
tree1bc371d016bdf23806e32d2204a2efaa0023fd6b
parent28d900836d476e0e4faf7d023f6a7f7b804e7b50
media: platform: mediatek: vpu: fix NULL ptr dereference

[ Upstream commit 3df55cd773e8603b623425cc97b05e542854ad27 ]

If pdev is NULL, then it is still dereferenced.

This fixes this smatch warning:

drivers/media/platform/mediatek/vpu/mtk_vpu.c:570 vpu_load_firmware() warn: address of NULL pointer 'pdev'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Yunfei Dong <yunfei.dong@mediatek.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/mediatek/vpu/mtk_vpu.c