]> www.infradead.org Git - users/dwmw2/linux.git/commit
media: rcar-csi2: Allocate v4l2_async_subdev dynamically
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 11 Aug 2020 20:59:38 +0000 (22:59 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 10 Sep 2020 12:27:26 +0000 (14:27 +0200)
commit2cac7cbfb4099980e78244359ab9c6f056d6a7ec
treedc6e4446334a22d5f9c48957a314fb01a04c4e73
parent468e986dac0e94194334ca6d0abf3af8c250792e
media: rcar-csi2: Allocate v4l2_async_subdev dynamically

v4l2_async_notifier_add_subdev() requires the asd to be allocated
dynamically, but the rcar-csi2 driver embeds it in the rcar_csi2
structure. This causes memory corruption when the notifier is destroyed
at remove time with v4l2_async_notifier_cleanup().

Fix this issue by registering the asd with
v4l2_async_notifier_add_fwnode_subdev(), which allocates it dynamically
internally.

Fixes: 769afd212b16 ("media: rcar-csi2: add Renesas R-Car MIPI CSI-2 receiver driver")
Signed-off-by: Laurent Pinchart <laurent.pinchart+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/platform/rcar-vin/rcar-csi2.c