diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2009-09-02 02:12:26 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:40:35 -0500 |
commit | 1a969d9863a0c8890eb799ec710dda9701f10483 (patch) | |
tree | 84174637b4f3e57fe5d417e2500b269b581f44ef | |
parent | 4e7387858f35eace117493e4ad69d3b7ccc84a41 (diff) |
V4L/DVB (13151): uvcvideo: Dismiss privileges when freeing video buffers
Dismiss privileges on the file handle when calling VIDIOC_REQBUFS with a
buffer count of 0. This allows applications to release the streaming
permissions on the file handle without closing it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/uvc/uvc_v4l2.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c index 7c555712411a..94c1d6696af5 100644 --- a/drivers/media/video/uvc/uvc_v4l2.c +++ b/drivers/media/video/uvc/uvc_v4l2.c | |||
@@ -364,7 +364,8 @@ static int uvc_v4l2_set_streamparm(struct uvc_streaming *stream, | |||
364 | * unprivileged state. Only a single instance can be in a privileged state at | 364 | * unprivileged state. Only a single instance can be in a privileged state at |
365 | * a given time. Trying to perform an operation that requires privileges will | 365 | * a given time. Trying to perform an operation that requires privileges will |
366 | * automatically acquire the required privileges if possible, or return -EBUSY | 366 | * automatically acquire the required privileges if possible, or return -EBUSY |
367 | * otherwise. Privileges are dismissed when closing the instance. | 367 | * otherwise. Privileges are dismissed when closing the instance or when |
368 | * freeing the video buffers using VIDIOC_REQBUFS. | ||
368 | * | 369 | * |
369 | * Operations that require privileges are: | 370 | * Operations that require privileges are: |
370 | * | 371 | * |
@@ -884,6 +885,9 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) | |||
884 | if (ret < 0) | 885 | if (ret < 0) |
885 | return ret; | 886 | return ret; |
886 | 887 | ||
888 | if (ret == 0) | ||
889 | uvc_dismiss_privileges(handle); | ||
890 | |||
887 | rb->count = ret; | 891 | rb->count = ret; |
888 | ret = 0; | 892 | ret = 0; |
889 | break; | 893 | break; |