diff options
author | Dave Airlie <airlied@redhat.com> | 2022-02-14 03:52:27 +0300 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2022-02-14 03:52:27 +0300 |
commit | b9c7babe2c2e37a50aa42401b38d597ea78f506e (patch) | |
tree | dd6ec30f2583f8860e69a74e4779ac20e3f53bff /drivers/misc/fastrpc.c | |
parent | 123db17ddff007080d464e785689fb14f94cbc7a (diff) | |
parent | 754e0b0e35608ed5206d6a67a791563c631cec07 (diff) | |
download | linux-b9c7babe2c2e37a50aa42401b38d597ea78f506e.tar.xz |
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.c | 9 |
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; } |