aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-03-27 07:04:23 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-04-14 18:45:23 -0400
commitcd634f1bfc182e564f33809fdca33027bb99fceb (patch)
treee81c3b626866a64b8152576cb500ee2fc2fe40a0 /drivers/media/usb
parentdfc2e12df02d49a1567bc90989ceef870cf5b147 (diff)
[media] v4l2: put VIDIOC_DBG_G_CHIP_NAME under ADV_DEBUG
Only enable this ioctl if the VIDEO_ADV_DEBUG config option is set. This prevents abuse from both userspace and kernelspace (some bridge drivers abuse DBG_G_CHIP_IDENT, lets prevent that from happening again with this ioctl). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/em28xx/em28xx-video.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 792ead1025d7..39951f5731e1 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -1331,6 +1331,7 @@ static int vidioc_g_chip_ident(struct file *file, void *priv,
1331 return 0; 1331 return 0;
1332} 1332}
1333 1333
1334#ifdef CONFIG_VIDEO_ADV_DEBUG
1334static int vidioc_g_chip_name(struct file *file, void *priv, 1335static int vidioc_g_chip_name(struct file *file, void *priv,
1335 struct v4l2_dbg_chip_name *chip) 1336 struct v4l2_dbg_chip_name *chip)
1336{ 1337{
@@ -1346,7 +1347,6 @@ static int vidioc_g_chip_name(struct file *file, void *priv,
1346 return 0; 1347 return 0;
1347} 1348}
1348 1349
1349#ifdef CONFIG_VIDEO_ADV_DEBUG
1350static int em28xx_reg_len(int reg) 1350static int em28xx_reg_len(int reg)
1351{ 1351{
1352 switch (reg) { 1352 switch (reg) {
@@ -1796,8 +1796,8 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
1796 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 1796 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
1797 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 1797 .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
1798 .vidioc_g_chip_ident = vidioc_g_chip_ident, 1798 .vidioc_g_chip_ident = vidioc_g_chip_ident,
1799 .vidioc_g_chip_name = vidioc_g_chip_name,
1800#ifdef CONFIG_VIDEO_ADV_DEBUG 1799#ifdef CONFIG_VIDEO_ADV_DEBUG
1800 .vidioc_g_chip_name = vidioc_g_chip_name,
1801 .vidioc_g_register = vidioc_g_register, 1801 .vidioc_g_register = vidioc_g_register,
1802 .vidioc_s_register = vidioc_s_register, 1802 .vidioc_s_register = vidioc_s_register,
1803#endif 1803#endif