From b8b805a550e6bf5b0abf8e77d02283fa02b5a754 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Fri, 29 Apr 2011 23:30:10 +0300 Subject: [PATCH] hiddev: Fix bug when matching incorrect device IDs If device IDs don't match, we must return negative error code in order to let the caller know about the error. Signed-off-by: Timo Kokkonen --- hiddev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hiddev.c b/hiddev.c index 7cf7239..6bbd15b 100644 --- a/hiddev.c +++ b/hiddev.c @@ -139,6 +139,7 @@ static int _hiddev_open(const char *device_path, int *usage_code, vendor_id == device_info.vendor) return fd; trace(3, "Vendor and product IDs don't match\n"); + ret = -1; goto err_close; } -- 2.45.0