OSDN Git Service

media: ov2680: fix null dereference at power on
authorRui Miguel Silva <rui.silva@linaro.org>
Wed, 21 Nov 2018 10:59:55 +0000 (05:59 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 23 Nov 2018 10:16:29 +0000 (05:16 -0500)
commitc45fbdf24c61a7b7a37f1b3bbd46f054637a3627
tree1dbc6cf0c4f30d6340d10b742b133169effe3723
parent5f229dcabc4acfb4e233e7678569f0fb9ab9c469
media: ov2680: fix null dereference at power on

Swapping the order between v4l2 subdevice registration and checking chip
id in b7a417628abf ("media: ov2680: don't register the v4l2 subdevice
before checking chip ID") makes the mode restore to use the sensor
controls before they are set, so move the mode restore call to s_power
after the handler setup for controls is done.

This remove also the need for the error code path in power on function.

Fixes: b7a417628abf ("media: ov2680: don't register the v4l2 subdevice before checking chip ID")

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/ov2680.c