From: Dave Airlie Date: Mon, 1 Sep 2014 09:44:19 +0000 (+1000) Subject: loader: fds can be 0 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=291ae622fd723d5ee2e08bbb8256c51bb5bce008;p=mesa.git loader: fds can be 0 Possible resource leak reported by coverity. Reported-by: Coverity scanner. Reviewed-by: Kenneth Graunke Signed-off-by: Dave Airlie --- diff --git a/src/loader/loader.c b/src/loader/loader.c index 47e1f58746c..bdd39069149 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;