diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2018-09-12 06:50:16 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2023-01-06 06:30:53 +0100 |
commit | 12dfcb15bbec3ca983da0a040766864899dfa15c (patch) | |
tree | a46eff410066f21183eccefdf6e330a4e33df151 | |
parent | 4e0898f30f13c1d492b86a5404b73d8b6baa40af (diff) | |
download | linux-drm-udmabuf.tar.gz |
udmabuf: add sanity checkdrm-udmabuf
Check that flags has no unsupported bits set.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reported-by: Yann Droneaud <ydroneaud@opteya.com>
-rw-r--r-- | drivers/dma-buf/udmabuf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index c35c7cd5516f..fb7a4c93f24e 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c @@ -213,6 +213,9 @@ static long udmabuf_create(struct miscdevice *device, int seals, ret = -EINVAL; u32 i, flags; + if (head->flags & ~UDMABUF_FLAGS_CLOEXEC) + return -EINVAL; + ubuf = kzalloc(sizeof(*ubuf), GFP_KERNEL); if (!ubuf) return -ENOMEM; |