]> git.itanic.dy.fi Git - glucose/commitdiff
hiddev: Fix bug when matching incorrect device IDs
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Fri, 29 Apr 2011 20:30:10 +0000 (23:30 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Fri, 29 Apr 2011 20:30:10 +0000 (23:30 +0300)
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 <kaapeli@itanic.dy.fi>
hiddev.c

index 7cf7239e3b5bc57b2961be6344ff6889cafc55e4..6bbd15b790b7ff54f8d62c2afdc0fe785de8b3e5 100644 (file)
--- 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;
        }