]> git.baikalelectronics.ru Git - kernel.git/commit
dma-buf/udmabuf: Fix NULL pointer dereference in udmabuf_create
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 4 Sep 2018 19:07:49 +0000 (14:07 -0500)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 5 Sep 2018 06:28:28 +0000 (08:28 +0200)
commite0cdaffb73cfd017d27d3fc9c7ed876aa354b335
tree375baeae4e1290f05cf9d1f0de43c2982574e2cb
parente7ae4be5566c15e76277bd7f4f012359046868d3
dma-buf/udmabuf: Fix NULL pointer dereference in udmabuf_create

There is a potential execution path in which pointer memfd is NULL when
passed as argument to fput(), hence there is a NULL pointer dereference
in fput().

Fix this by null checking *memfd* before calling fput().

Addresses-Coverity-ID: 1473174 ("Explicit null dereferenced")
Fixes: 08da6f57397d ("Add udmabuf misc device")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20180904190749.GA9308@embeddedor.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
drivers/dma-buf/udmabuf.c