iris: consider bufmgr creation to have failed if `dup`ing of the fd fails
authorDylan Baker <dylan.c.baker@intel.com>
Mon, 27 Feb 2023 18:55:25 +0000 (10:55 -0800)
committerMarge Bot <emma+marge@anholt.net>
Tue, 28 Feb 2023 19:58:58 +0000 (19:58 +0000)
commit814eb9e2ceae538abbb56ee762074e59b014b3c3
tree0883946aff5fe1840b084e117128cc83f9deeaf7
parent0912b14b3aea97c28c844fbdda49d309e6c67af0
iris: consider bufmgr creation to have failed if `dup`ing of the fd fails

Coverity points out that we can pass a negative value to `close()`,
which results in an unchecked error. While this is technically true, it
really isn't a problem as `close()` is speced to return -1 in that case
(which we ignore). However, what is true is that if we fail to dup the
fd (the only case where we could end up with a negative value), then
we're in an unrecoverable error state anyway, and should go to the error
cleanup code.

CID: 1521539
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marcin Ĺšlusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21568>
src/gallium/drivers/iris/iris_bufmgr.c