pipe-loader: add a dup() in pipe_loader_sw_probe_kms
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 30 Aug 2018 16:24:16 +0000 (17:24 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 3 Oct 2018 12:38:05 +0000 (13:38 +0100)
commit7419b224139b47ea98d1bc4c5dab7370076b214f
tree436a7801004f0f1388109c9031bc3f08faef98e1
parent6ccc435e7ad92bb0ba77d3fdb48c7127ba71239e
pipe-loader: add a dup() in pipe_loader_sw_probe_kms

The pipe_loader_release API closes the fd given, even if the pipe-loader
should _not_ take ownership of it.

With earlier commit we fixed pipe_loader_drm_probe_fd, and now with
cover the final piece.

Note that unlike the DRM case, here the caller _did_ forget to dup
before using it ... most likely leading to all sorts of fun.

Don't forget the close in the error path. Seems like the things are a
bit leaky/asymmetrical with the semi-recent config work. But we can shave
that yak another day ;-)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
src/gallium/auxiliary/pipe-loader/pipe_loader.h
src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c