media: venus: core: Fix a potential NULL pointer dereference in an error handling...
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 12 Aug 2021 05:14:22 +0000 (07:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:53:51 +0000 (10:53 +0100)
commit50c4244906d654605639f9b6aecf8bd95050304b
tree31dfb94804328036de7087e86665a5b0833a78fd
parenteeefa2eae8fc82ad757a2241b9f82ac33e99e6b4
media: venus: core: Fix a potential NULL pointer dereference in an error handling path

[ Upstream commit e4debea9be7d5db52bc6a565a4c02c3c6560d093 ]

The normal path of the function makes the assumption that
'pm_ops->core_power' may be NULL.
We should make the same assumption in the error handling path or a NULL
pointer dereference may occur.

Add the missing test before calling 'pm_ops->core_power'

Fixes: 9e8efdb57879 ("media: venus: core: vote for video-mem path")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/qcom/venus/core.c