summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2017-01-15 20:05:30 +0100
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-02-03 17:23:38 +0100
commit909aa003eb7239161f0fa5773878035ed1754cf4 (patch)
tree000c2937691c877ccc2582b714054c57434de214 /drivers
parent[media] coda: add Freescale firmware compatibility location (diff)
downloadlinux-909aa003eb7239161f0fa5773878035ed1754cf4.tar.xz
linux-909aa003eb7239161f0fa5773878035ed1754cf4.zip
[media] v4l: subdev: Clean up properly in subdev devnode registration error path
Set the subdev devnode pointer right after registration to ensure that later errors won't skip the subdev when unregistering all devnodes. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/v4l2-core/v4l2-device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c
index 62bbed76dbbc..f364cc1b521d 100644
--- a/drivers/media/v4l2-core/v4l2-device.c
+++ b/drivers/media/v4l2-core/v4l2-device.c
@@ -253,6 +253,7 @@ int v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev)
kfree(vdev);
goto clean_up;
}
+ sd->devnode = vdev;
#if defined(CONFIG_MEDIA_CONTROLLER)
sd->entity.info.dev.major = VIDEO_MAJOR;
sd->entity.info.dev.minor = vdev->minor;
@@ -270,7 +271,6 @@ int v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev)
}
}
#endif
- sd->devnode = vdev;
}
return 0;