From 33ced3dfb7fe39a81b5552be7e53454ea5235e3a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 31 Jul 2019 08:23:58 +1000 Subject: [PATCH] hidpp10: if we can't fetch the current profile, error out Right now we initialize any hidpp10 device with one profile and then go and fetch the data. But we never check for return codes, so it always succeeds even when we can't get anything out of the device at all. Eventually we fail the sanity checks with "invalid dpi list" which is confusing at best. Let's avoid this by requiring at least the current profile to work. This will break devices that have a single emulated profile, i.e. those that don't have profiles but rely on libratbag to emulate one based on the current-resolution/current-... calls. Not sure we actually support any of those, so let's see. Closes #738 though it doesn't fix it, it just bails out better. Signed-off-by: Peter Hutterer --- src/hidpp10.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hidpp10.c b/src/hidpp10.c index 66782c95..ff278bf4 100644 --- a/src/hidpp10.c +++ b/src/hidpp10.c @@ -2751,8 +2751,7 @@ hidpp10_get_device_info(struct hidpp10_device *dev) hidpp10_get_optical_sensor_settings(dev, &reflect); - hidpp10_get_current_profile(dev, ¤t_profile); - return 0; + return hidpp10_get_current_profile(dev, ¤t_profile); } struct hidpp10_device*