Skip to content
Commit 508a5f77 authored by Thierry Reding's avatar Thierry Reding
Browse files

omap: Initialize DMA BUF file descriptor to -1



Commit c86dabfc ("omap: zero is a valid fd number, treat it as
such") corrected checks for valid file descriptors, but the OMAP buffer
object code initializes the DMA-BUF file descriptor to 0 (as a result of
calloc()'ing the structure). Obviously this isn't going to work because
subsequent code will try to use file descriptor 0 (most likely stdin at
that point) as a DMA-BUF. It may also try and close stdin when a buffer
object is destroyed.

Fix this by initializing the DMA-BUF file descriptor to -1, properly
marking it as an invalid file descriptor.

Fixes: c86dabfc ("omap: zero is a valid fd number, treat it as such")
Reported-by: default avatarRobert Nelson <robertcnelson@gmail.com>
Tested-by: default avatarRobert Nelson <robertcnelson@gmail.com>
Reviewed-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent a5ea0c64
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment