gbm: return appropriate error when queryImage() fails
authorNicholas Bishop <nbishop@neverware.com>
Thu, 8 Sep 2016 19:55:02 +0000 (15:55 -0400)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 27 Sep 2016 12:37:21 +0000 (13:37 +0100)
commit2d05ba2ca0af336ceae3167432d7df9df3366b74
tree1dc90142959190c9bb0ce477b41e0f9788954e04
parenta5993022275c20061ac025d9adc26c5f9d02afee
gbm: return appropriate error when queryImage() fails

Change gbm_dri_bo_get_fd to check the return value of queryImage and
return -1 (an invalid file descriptor) if an error occurs.

Update the comment for gbm_bo_get_fd to return -1, since (apart from the
above) we've already return -1 on error.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Nicholas Bishop <nbishop@neverware.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
[Emil Velikov: Split from larger patch, polish coding style, cc stable]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
src/gbm/backends/dri/gbm_dri.c
src/gbm/main/gbm.c