1
0
forked from drath/libratbag

hidraw: Definitely return EINVAL when the device ids don't match

Don't return an undefined errno.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2015-08-20 14:37:25 +10:00
parent 589f249c95
commit 2268bad104

View File

@@ -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;