From: Timo Kokkonen Date: Fri, 29 Apr 2011 20:30:10 +0000 (+0300) Subject: hiddev: Fix bug when matching incorrect device IDs X-Git-Url: http://git.itanic.dy.fi/?p=glucose;a=commitdiff_plain;h=b8b805a550e6bf5b0abf8e77d02283fa02b5a754 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 --- 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; }