hidraw: do not return success if match failed

rc is set to 0 by ratbag_open_hidraw_node(), and if matched failed, we
close the hidraw node and end the loop.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Benjamin Tissoires
2016-04-29 12:10:41 +02:00
parent 22abddc9d4
commit 1da0180e0f

View File

@@ -1417,10 +1417,9 @@ ratbag_find_hidraw_node(struct ratbag_device *device,
goto skip;
matched = match(device);
if (matched == 1) {
rc = 0;
rc = matched ? 0 : -ENODEV;
if (matched == 1)
goto out;
}
skip:
ratbag_close_hidraw(device);