From 39069623f21ad047b3e5eae0ae49b16bf9c83ea5 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Tue, 1 Mar 2016 14:36:03 +0100 Subject: [PATCH] hidpp20drv: bail out if the features are not working as expected Signed-off-by: Benjamin Tissoires --- src/driver-hidpp20.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/driver-hidpp20.c b/src/driver-hidpp20.c index 774ce1be..35fd3ba6 100644 --- a/src/driver-hidpp20.c +++ b/src/driver-hidpp20.c @@ -734,6 +734,7 @@ hidpp20drv_20_probe(struct ratbag_device *device) struct hidpp20_device *dev = drv_data->dev; struct hidpp20_feature *feature_list = dev->feature_list; unsigned int i; + int rc; log_raw(device->ratbag, "'%s' has %d features\n", @@ -744,7 +745,9 @@ hidpp20drv_20_probe(struct ratbag_device *device) log_raw(device->ratbag, "Init feature %s (0x%04x) \n", hidpp20_feature_get_name(feature_list[i].feature), feature_list[i].feature); - hidpp20drv_init_feature(device, feature_list[i].feature); + rc = hidpp20drv_init_feature(device, feature_list[i].feature); + if (rc < 0) + return rc; } return 0;