diff mbox series

[v3,3/3] udmabuf: check that flags has no unsupported bits set

Message ID 20180912063316.21047-4-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show
Series [v3,1/3] udmabuf: add documentation | expand

Commit Message

Gerd Hoffmann Sept. 12, 2018, 6:33 a.m. UTC
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reported-by: Yann Droneaud <ydroneaud@opteya.com>
---
 drivers/dma-buf/udmabuf.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
index 964beadd11..acd97670c5 100644
--- a/drivers/dma-buf/udmabuf.c
+++ b/drivers/dma-buf/udmabuf.c
@@ -128,6 +128,9 @@  static long udmabuf_create(const struct udmabuf_create_list *head,
 	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;