Blob Blame History Raw
From debc83723927f0fb3d16098f8b7388bdb6db855b Mon Sep 17 00:00:00 2001
From: Jason Gerecke <killertofu@gmail.com>
Date: Fri, 5 Dec 2014 13:39:26 -0800
Subject: [PATCH] Ensure input device fd gets closed after use

Fixes a minor error in commit 52fe01c which results in the driver
invalidating an fd prior to (potentially) closing it. This reversed
order causes us to leak the fd and can result in eventual exhasution.

Fixes SF #263

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
---
 src/xf86Wacom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
index e6962dd..55b8b7c 100644
--- a/src/xf86Wacom.c
+++ b/src/xf86Wacom.c
@@ -753,9 +753,9 @@ static void wcmDevClose(InputInfoPtr pInfo)
 
 	if (pInfo->fd >= 0)
 	{
-		pInfo->fd = -1;
 		if (!--common->fd_refs)
 			wcmClose(pInfo);
+		pInfo->fd = -1;
 	}
 }
 
-- 
2.1.0