From 2268bad1043b534620f9f4bbc4944c4f66adc435 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 20 Aug 2015 14:37:25 +1000 Subject: [PATCH] hidraw: Definitely return EINVAL when the device ids don't match Don't return an undefined errno. Signed-off-by: Peter Hutterer --- src/libratbag-hidraw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libratbag-hidraw.c b/src/libratbag-hidraw.c index 35259d27..e812be6b 100644 --- a/src/libratbag-hidraw.c +++ b/src/libratbag-hidraw.c @@ -60,8 +60,10 @@ ratbag_open_hidraw(struct ratbag_device *ratbag) /* Check if the device actually matches the input node */ if (info.bustype != ratbag->ids.bustype || info.vendor != ratbag->ids.vendor || - info.product != ratbag->ids.product) + info.product != ratbag->ids.product) { + errno = EINVAL; goto err; + } ratbag->hidraw_fd = fd;