st/dri: fd management cleanups
authorEmil Velikov <emil.l.velikov@gmail.com>
Mon, 23 Nov 2015 20:26:56 +0000 (20:26 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Sun, 29 Nov 2015 14:39:03 +0000 (14:39 +0000)
commitd90ba57c08dc51579c92224c7eedfc9f88f47853
tree51b5a807334baf4b9aa6c7ad2d529671009a6480
parent5f92906b876d5463efba3ffb19c1de0dcb3c755f
st/dri: fd management cleanups

Add some checks if the original/dup'd fd is valid and ensure that we
don't leak it on error. The former is implicitly handled within the
pipe_loader, although let's make things explicit and check beforehand.

Spotted by Coverity (CID 1339865)

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
src/gallium/state_trackers/dri/dri2.c