]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: ov2740: identify module after subdev initialisation
authorBingbu Cao <bingbu.cao@intel.com>
Thu, 13 Jan 2022 00:18:48 +0000 (01:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:43 +0000 (13:57 +0200)
commitd183fe68360791638f53c129015d618130ca4f89
tree5706679d19f9a102a6c707665e1980182271190b
parent5b3b0b7d6e2f5f87513c8d21213ce6245b21183b
media: ov2740: identify module after subdev initialisation

[ Upstream commit 54ade663d4bb606e23dbc4e0d49e2e9837dbb33f ]

The module identifying will try to get the sub device data which
will be ready after sub device initialisation, so if try to use the
subdev data to deference the client will cause NULL pointer
dereference, this patch move the module identification after
v4l2_i2c_subdev_init() to fix this issue, it also fixes duplicate
module idendification.

Fixes: ada2c4f54d0a ("media: ov2740: support device probe in non-zero ACPI D state")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/ov2740.c