From 291ae622fd723d5ee2e08bbb8256c51bb5bce008 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 1 Sep 2014 19:44:19 +1000 Subject: [PATCH] loader: fds can be 0 Possible resource leak reported by coverity. Reported-by: Coverity scanner. Reviewed-by: Kenneth Graunke Signed-off-by: Dave Airlie --- 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 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; -- 2.30.2