]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: hantro: Check whether reset op is defined before use
authorMarek Vasut <marex@denx.de>
Thu, 24 Aug 2023 01:38:58 +0000 (03:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:57:19 +0000 (11:57 +0100)
commit66b4c5f980d741f3a47e4b65eeaf2797f2d59294
tree052cb5cce7cb4ff1a617544f556e4f3b36b2a6f6
parenta2e2190d994a3bd5d01b180a5c8673af53599f2d
media: hantro: Check whether reset op is defined before use

[ Upstream commit 88d4b23a629ebd34f682f770cb6c2116c851f7b8 ]

The i.MX8MM/N/P does not define the .reset op since reset of the VPU is
done by genpd. Check whether the .reset op is defined before calling it
to avoid NULL pointer dereference.

Note that the Fixes tag is set to the commit which removed the reset op
from i.MX8M Hantro G2 implementation, this is because before this commit
all the implementations did define the .reset op.

Fixes: 6971efb70ac3 ("media: hantro: Allow i.MX8MQ G1 and G2 to run independently")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/verisilicon/hantro_drv.c