From a13ee32c61ed85d0b9425ff38a0ed7ddf52fc5a2 Mon Sep 17 00:00:00 2001 From: FFY00 Date: Sun, 26 May 2019 15:46:36 +0100 Subject: [PATCH] steelseries: fix bug where we were wrongly dellocating dpi_{range,list} _cleanup_ is deallocating the pointer returned by ratbag_device_data_steelseries_get_dpi_{range,list}(). Deallocating dpi_list results in a wrong step value, and a wrong step value then results in a wrong step count when we try to set the dpi. Fixes #436 and #702 --- src/driver-steelseries.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driver-steelseries.c b/src/driver-steelseries.c index f5c427e7..196699f9 100644 --- a/src/driver-steelseries.c +++ b/src/driver-steelseries.c @@ -271,8 +271,8 @@ steelseries_probe(struct ratbag_device *device) struct ratbag_button *button; struct ratbag_led *led; int rc, button_count, led_count, device_version, mono_led, short_button; - _cleanup_(dpi_list_freep) struct dpi_list *dpilist = NULL; - _cleanup_(freep) struct dpi_range *dpirange = NULL; + struct dpi_list *dpilist = NULL; + struct dpi_range *dpirange = NULL; unsigned int report_rates[] = { 125, 250, 500, 1000 };