media: s5p-mfc: Add checking to s5p_mfc_probe().
authorNadezda Lutovinova <lutovinova@ispras.ru>
Wed, 11 Aug 2021 13:32:28 +0000 (15:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:12 +0000 (19:16 +0100)
commitcdf5c3f846072f244cb66f34c2ef7b122ccca0a0
treee0bb07b6a09a8cfd812fc4f8868487da7e6f8d83
parentbb2cb679699ee42aff4142d081c2a57655c06b6d
media: s5p-mfc: Add checking to s5p_mfc_probe().

[ Upstream commit cdfaf4752e6915a4b455ad4400133e540e4dc965 ]

If of_device_get_match_data() return NULL,
then null pointer dereference occurs in  s5p_mfc_init_pm().
The patch adds checking if dev->variant is NULL.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Nadezda Lutovinova <lutovinova@ispras.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/s5p-mfc/s5p_mfc.c