From a13923ad9f04059ab3f4c902b388f1fe3a8cc1bd Mon Sep 17 00:00:00 2001 From: Andi Shyti Date: Thu, 9 Feb 2017 22:20:53 +0900 Subject: stmfts: fix close issue close if the file is not the right one (strncmp different than '0'), otherwise return because the file is the right one. Signed-off-by: Andi Shyti --- stmfts.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stmfts.c b/stmfts.c index 6d59fa2..7de07dd 100644 --- a/stmfts.c +++ b/stmfts.c @@ -200,12 +200,12 @@ int stmfts_open_event(char *fname) } ret = strncmp(fname, dev_name, STMFTS_INPUT_NAME_SIZE); - if (ret) + if (ret) { + close(fd); continue; + } return fd; - - close(fd); } error(0, ENODEV, "input device not found"); -- cgit v1.2.3