aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/misc/fastrpc.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2022-02-14 10:52:27 +1000
committerDave Airlie <airlied@redhat.com>2022-02-14 10:52:27 +1000
commitb9c7babe2c2e37a50aa42401b38d597ea78f506e (patch)
treedd6ec30f2583f8860e69a74e4779ac20e3f53bff /drivers/misc/fastrpc.c
parentMerge tag 'amd-drm-next-5.18-2022-02-11-1' of https://gitlab.freedesktop.org/agd5f/linux into drm-next (diff)
parentLinux 5.17-rc4 (diff)
downloadwireguard-linux-b9c7babe2c2e37a50aa42401b38d597ea78f506e.tar.xz
wireguard-linux-b9c7babe2c2e37a50aa42401b38d597ea78f506e.zip
Backmerge tag 'v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next
Daniel asked for this for some intel deps, so let's do it now. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/misc/fastrpc.c')
-rw-r--r--drivers/misc/fastrpc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 5c0503655212..d60b176ffa95 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -1288,7 +1288,14 @@ static int fastrpc_dmabuf_alloc(struct fastrpc_user *fl, char __user *argp)
}
if (copy_to_user(argp, &bp, sizeof(bp))) {
- dma_buf_put(buf->dmabuf);
+ /*
+ * The usercopy failed, but we can't do much about it, as
+ * dma_buf_fd() already called fd_install() and made the
+ * file descriptor accessible for the current process. It
+ * might already be closed and dmabuf no longer valid when
+ * we reach this point. Therefore "leak" the fd and rely on
+ * the process exit path to do any required cleanup.
+ */
return -EFAULT;
}