[Mesa-dev] [PATCH] loader: fds can be 0
Kenneth Graunke
kenneth at whitecape.org
Mon Sep 1 10:38:38 PDT 2014
On Monday, September 01, 2014 07:45:26 PM Dave Airlie wrote:
> Possible resource leak reported by coverity.
>
> Reported-by: Coverity scanner.
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> src/loader/loader.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/loader/loader.c b/src/loader/loader.c
> index 47e1f58..bdd3906 100644
> --- a/src/loader/loader.c
> +++ b/src/loader/loader.c
> @@ -402,7 +402,7 @@ int loader_get_user_preferred_fd(int default_fd, int *different_device)
> }
>
> fd = drm_open_device(device_name);
> - if (fd > 0) {
> + if (fd >= 0) {
> close(default_fd);
> } else {
> fd = default_fd;
>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140901/cbd29033/attachment.sig>
More information about the mesa-dev
mailing list