linux_dsm_epyc7002/drivers/media
Hans Verkuil ff05cb4b81 [media] vb2: check if vb2_fop_write/read is allowed
Return -EINVAL if read() or write() is not supported by the queue. This
makes it possible to provide both vb2_fop_read and vb2_fop_write in a
struct v4l2_file_operations since the vb2_fop_* function will check if
the file operation is allowed.

A similar check exists in __vb2_init_fileio() which is called from
__vb2_perform_fileio(), but that check is only done if no file I/O is
active. So the sequence of read() followed by write() would be allowed,
which is obviously a bug.

In addition, vb2_fop_write/read should always return -EINVAL if the
operation is not allowed, and by putting the check in the lower levels
of the code it is possible that other error codes are returned (EBUSY
or ERESTARTSYS).

All these issues are avoided by just doing a quick explicit check.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02 18:10:25 -03:00
..
common [media] saa7146: replace current->state by set_current_state() 2015-03-03 11:15:42 -03:00
dvb-core [media] use a function for DVB media controller register 2015-03-02 11:29:39 -03:00
dvb-frontends [media] mn88473: calculate the IF register values 2015-03-03 13:07:55 -03:00
firewire [media] firewire: Deletion of an unnecessary check before the function call "dvb_unregister_device" 2014-11-25 13:30:31 -02:00
i2c [media] smiapp: Make pixel_order_str static 2015-04-02 17:28:36 -03:00
mmc [media] siano: register media controller earlier 2015-02-26 09:10:39 -03:00
pci [media] cx18: Fix bytes_per_line 2015-03-03 11:24:34 -03:00
platform [media] media: am437x: Don't release OF node reference twice 2015-04-02 18:10:06 -03:00
radio [media] media: radio: handle timeouts 2015-03-02 16:50:42 -03:00
rc [media] ir-hix5hd2: remove writel/readl_relaxed define 2015-02-11 20:23:52 -02:00
tuners [media] si2157: extend frequency range for ATSC 2015-04-01 06:22:26 -03:00
usb [media] uvcvideo: Validate index during step-wise frame intervals enumeration 2015-04-02 17:31:48 -03:00
v4l2-core [media] vb2: check if vb2_fop_write/read is allowed 2015-04-02 18:10:25 -03:00
Kconfig [media] dvbdev: add support for media controller 2015-02-13 21:10:12 -02:00
Makefile [media] bq/c-qcam, w9966, pms: move to staging in preparation for removal 2014-12-16 23:21:44 -02:00
media-device.c [media] media: Use strlcpy instead of custom code 2014-09-21 20:27:08 -03:00
media-devnode.c [media] media-devnode: just return 0 instead of using a var 2014-09-03 17:59:28 -03:00
media-entity.c [media] media: Fix a compiler warning in media_entity_pipeline_start() 2014-11-03 19:09:13 -02:00