Skip to contentSkip to conversation

em28xx: return -ENOTTY for VBI-format ioctls if the device doesn't support VBI

PATCH New Frank Schäfer 1 participant 1 message Jan 13, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 em28xx: return -ENOTTY for VBI-format ioctls if the device doesn't support VBI

---
 drivers/media/usb/em28xx/em28xx-video.c |    6 ++++++

1 Datei geändert, 6 Zeilen hinzugefügt(+)

drivers/media/usb/em28xx/em28xx-video.c +6 -0
index 4a7f73c..c43e4c5 100644
@@ -1507,6 +1507,9 @@ static int vidioc_g_fmt_vbi_cap(struct file *file, void *priv,
 	struct em28xx_fh      *fh  = priv;
 	struct em28xx         *dev = fh->dev;
 
+	if (!em28xx_vbi_supported(dev))
+		return -ENOTTY;
+
 	format->fmt.vbi.samples_per_line = dev->vbi_width;
 	format->fmt.vbi.sample_format = V4L2_PIX_FMT_GREY;
 	format->fmt.vbi.offset = 0;
@@ -1536,6 +1539,9 @@ static int vidioc_s_fmt_vbi_cap(struct file *file, void *priv,
 	struct em28xx_fh      *fh  = priv;
 	struct em28xx         *dev = fh->dev;
 
+	if (!em28xx_vbi_supported(dev))
+		return -ENOTTY;
+
 	format->fmt.vbi.samples_per_line = dev->vbi_width;
 	format->fmt.vbi.sample_format = V4L2_PIX_FMT_GREY;
 	format->fmt.vbi.offset = 0;
Signature · 1 line
1.7.10.4