From 42caf3bc948719ee3ae52ae0d0fe651a996415ff Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 13 Sep 2018 11:35:27 +1000 Subject: [PATCH] hidpp20: fix self-assignment Going by the comment above, this needs to be endian-converted. Found by coverity Signed-off-by: Peter Hutterer --- src/hidpp20.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hidpp20.c b/src/hidpp20.c index 444f816c..7072dae3 100644 --- a/src/hidpp20.c +++ b/src/hidpp20.c @@ -650,8 +650,7 @@ int hidpp20_led_sw_control_get_led_state(struct hidpp20_device* device, state = (struct hidpp20_led_sw_ctrl_led_state*) msg.msg.parameters; // This field has to be stored in little-endian - state->mode = state->mode; - + state->mode = hidpp_be_u16_to_cpu(state->mode); if (state->mode == HIDPP20_LED_MODE_BREATHING) { // Only parameters that is reported by these LEDs is brightness when breathing state->breathing.brightness = hidpp_be_u16_to_cpu(state->breathing.brightness);