OSDN Git Service

media: i2c: max9286: fix access to unallocated memory
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Mon, 18 Jan 2021 08:14:46 +0000 (09:14 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 6 Feb 2021 07:38:06 +0000 (08:38 +0100)
commite88ccf09e79cf33cac40316ba69c820d9eebc82b
tree1cb9fba21c401a1e237f8cfb31cf8716ad3f181c
parentc432147c771d5efe00d0e96ceb7779636cd31300
media: i2c: max9286: fix access to unallocated memory

The asd allocated with v4l2_async_notifier_add_fwnode_subdev() must be
of size max9286_asd, otherwise access to max9286_asd->source will go to
unallocated memory.

Fixes: 86d37bf31af6 ("media: i2c: max9286: Allocate v4l2_async_subdev dynamically")
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: stable@vger.kernel.org # v5.10+
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/max9286.c