[media] v4l: Allow calling v4l2_device_register_subdev_nodes() multiple times
authorSebastian Reichel <sre@kernel.org>
Tue, 14 Feb 2017 22:38:49 +0000 (20:38 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 22 Mar 2017 14:21:43 +0000 (11:21 -0300)
commitdb0f4691d9749d5dd758b8636290cec8fd88aa26
tree0d064f4cc992770d0208b88fabcc8c963e14680d
parent974f4a385cbf7fe056b51b39f7ef8cbf9528a57c
[media] v4l: Allow calling v4l2_device_register_subdev_nodes() multiple times

Previously multiple calls to v4l2_device_register_subdev_nodes() ended up
corrupting memory and leaking some, too. This patch changes the behaviour so
that sub-devices the device nodes of which are already registered are
ignored.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/v4l2-core/v4l2-device.c