summaryrefslogtreecommitdiff
path: root/drivers/media/media-request.c
diff options
context:
space:
mode:
authorHans Verkuil <hansverk@cisco.com>2018-08-23 13:14:12 +0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-11 16:45:58 +0300
commit34b41472465b1b5a2c6c63255431fb2c1a450af1 (patch)
tree4d69723646404eeada387d7ac8c46a62fddd64aa /drivers/media/media-request.c
parent757fdb51c14fda221ccb6999a865f7f895c79750 (diff)
downloadlinux-34b41472465b1b5a2c6c63255431fb2c1a450af1.tar.xz
media: media-request: return -EINVAL for invalid request_fds
Instead of returning -ENOENT when a request_fd was not found (VIDIOC_QBUF and VIDIOC_G/S/TRY_EXT_CTRLS), we now return -EINVAL. This is in line with what we do when invalid dmabuf fds are passed to e.g. VIDIOC_QBUF. Also document that EINVAL is returned for invalid m.fd values, we never documented that. Signed-off-by: Hans Verkuil <hansverk@cisco.com> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/media-request.c')
-rw-r--r--drivers/media/media-request.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/media-request.c b/drivers/media/media-request.c
index 4b0ce8fde7c9..4cee67e6657e 100644
--- a/drivers/media/media-request.c
+++ b/drivers/media/media-request.c
@@ -244,7 +244,7 @@ media_request_get_by_fd(struct media_device *mdev, int request_fd)
filp = fget(request_fd);
if (!filp)
- return ERR_PTR(-ENOENT);
+ goto err_no_req_fd;
if (filp->f_op != &request_fops)
goto err_fput;
@@ -268,7 +268,9 @@ media_request_get_by_fd(struct media_device *mdev, int request_fd)
err_fput:
fput(filp);
- return ERR_PTR(-ENOENT);
+err_no_req_fd:
+ dev_dbg(mdev->dev, "cannot find request_fd %d\n", request_fd);
+ return ERR_PTR(-EINVAL);
}
EXPORT_SYMBOL_GPL(media_request_get_by_fd);