All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] v4l2: device_register_subdev_nodes: allow calling multiple times
@ 2017-02-14 22:38 Pavel Machek
  2017-02-14 22:38 ` [PATCH 2/4] Core changes for CCP2/CSI1 support Pavel Machek
                   ` (3 more replies)
  0 siblings, 4 replies; 34+ messages in thread
From: Pavel Machek @ 2017-02-14 22:38 UTC (permalink / raw)
  To: sakari.ailus
  Cc: sre, pali.rohar, pavel, linux-media, linux-kernel,
	laurent.pinchart, mchehab, ivo.g.dimitrov.75

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

From: Sebastian Reichel <sre@kernel.org>

If v4l2_device_register_subdev_nodes() is called multiple times, it is
better to return early than corrupt memory.

Without this, exposure / gain controls do not work in the camera
application on N900.

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>
---
 drivers/media/v4l2-core/v4l2-device.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c
index f364cc1..937c6de 100644
--- a/drivers/media/v4l2-core/v4l2-device.c
+++ b/drivers/media/v4l2-core/v4l2-device.c
@@ -235,6 +235,9 @@ int v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev)
 		if (!(sd->flags & V4L2_SUBDEV_FL_HAS_DEVNODE))
 			continue;
 
+		if (sd->devnode)
+			continue;
+
 		vdev = kzalloc(sizeof(*vdev), GFP_KERNEL);
 		if (!vdev) {
 			err = -ENOMEM;
-- 
2.1.4


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply related	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2017-03-04 19:20 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-14 22:38 [PATCH 1/4] v4l2: device_register_subdev_nodes: allow calling multiple times Pavel Machek
2017-02-14 22:38 ` [PATCH 2/4] Core changes for CCP2/CSI1 support Pavel Machek
2017-02-14 22:39 ` [PATCH 3/4] smiapp: add CCP2 support Pavel Machek
2017-02-14 22:39 ` [PATCH 4/4] v4l: split lane parsing code Pavel Machek
2017-02-20 10:31 ` [PATCH 1/4] v4l2: device_register_subdev_nodes: allow calling multiple times Pavel Machek
2017-02-20 13:09   ` Sakari Ailus
2017-02-20 13:56     ` Sakari Ailus
2017-02-21 11:07       ` Pavel Machek
2017-02-21 11:11         ` Sakari Ailus
2017-02-23 22:52           ` Pavel Machek
2017-02-25  0:09           ` Pavel Machek
2017-02-25 13:44             ` Sakari Ailus
2017-02-25 21:53               ` camera subdevice support was " Pavel Machek
2017-02-25 22:56                 ` Pavel Machek
2017-02-25 23:17                 ` Sakari Ailus
2017-02-26  8:38                   ` Pavel Machek
2017-02-26 21:36                     ` Sakari Ailus
2017-03-04  8:55                   ` Pavel Machek
2017-03-04 12:30                     ` Sakari Ailus
2017-03-04 19:05                       ` Pavel Machek
2017-03-04 19:20                       ` Pavel Machek
2017-03-02  9:07               ` subdevice config into pointer (was Re: [PATCH 1/4] v4l2: device_register_subdev_nodes: allow calling multiple times) Pavel Machek
2017-03-02 14:16                 ` Sakari Ailus
2017-03-02 14:58                   ` Pavel Machek
2017-03-02 15:13                     ` Sakari Ailus
2017-03-03 23:24                       ` Pavel Machek
2017-03-02 18:39                   ` Laurent Pinchart
2017-03-02 21:03                     ` Pavel Machek
2017-03-02 21:18                     ` Sakari Ailus
2017-02-25 22:12           ` [PATCH 1/4] v4l2: device_register_subdev_nodes: allow calling multiple times Pavel Machek
2017-02-27 19:43             ` Pavel Machek
2017-02-27 20:54             ` Sakari Ailus
2017-02-28  9:17               ` Pavel Machek
2017-02-28 11:38               ` [PATCH] omap3isp: Parse CSI1 configuration from the device tree Pavel Machek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.