aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/v4l2-dev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index 682f48aadcac..c5ca51a9020a 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -162,6 +162,10 @@ static int get_index(struct video_device *vdev, int num)
162 return -EINVAL; 162 return -EINVAL;
163 } 163 }
164 164
165 /* Some drivers do not set the parent. In that case always return 0. */
166 if (vdev->parent == NULL)
167 return 0;
168
165 for (i = 0; i < VIDEO_NUM_DEVICES; i++) { 169 for (i = 0; i < VIDEO_NUM_DEVICES; i++) {
166 if (video_device[i] != NULL && 170 if (video_device[i] != NULL &&
167 video_device[i] != vdev && 171 video_device[i] != vdev &&