media: hantro: Check whether reset op is defined before use
[ Upstream commit88d4b23a62
] 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:6971efb70a
("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f258fd94ab
commit
64f55cebb4
@ -125,7 +125,8 @@ void hantro_watchdog(struct work_struct *work)
|
||||
ctx = v4l2_m2m_get_curr_priv(vpu->m2m_dev);
|
||||
if (ctx) {
|
||||
vpu_err("frame processing timed out!\n");
|
||||
ctx->codec_ops->reset(ctx);
|
||||
if (ctx->codec_ops->reset)
|
||||
ctx->codec_ops->reset(ctx);
|
||||
hantro_job_finish(vpu, ctx, VB2_BUF_STATE_ERROR);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user