]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: i2c: ov5647: Initialize subdev before controls
authorJai Luthra <jai.luthra@ideasonboard.com>
Mon, 22 Dec 2025 08:15:25 +0000 (13:45 +0530)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 14 Jan 2026 22:33:02 +0000 (23:33 +0100)
commiteee13cbccacb6d0a3120c126b8544030905b069d
treedc2accdf5bfd3ce07987aed3fab12299bae11d18
parentee71368a5666cedb0c603d9eea3a6f0c079f88cc
media: i2c: ov5647: Initialize subdev before controls

In ov5647_init_controls() we call v4l2_get_subdevdata, but it is
initialized by v4l2_i2c_subdev_init() in the probe, which currently
happens after init_controls(). This can result in a segfault if the
error condition is hit, and we try to access i2c_client, so fix the
order.

Fixes: 4974c2f19fd8 ("media: ov5647: Support gain, exposure and AWB controls")
Cc: stable@vger.kernel.org
Suggested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/ov5647.c