Skip to content
Commit 81c8bf91 authored by Tom Rix's avatar Tom Rix Committed by Jiri Kosina
Browse files

HID: logitech-hidpp: initialize level variable

Static analysis reports this representative problem

hid-logitech-hidpp.c:1356:23: warning: Assigned value is
  garbage or undefined
        hidpp->battery.level = level;
                             ^ ~~~~~

In some cases, 'level' is never set in hidpp20_battery_map_status_voltage()
Since level is not available on all hw, initialize level to unknown.

Fixes: be281368

 ("hid-logitech-hidpp: read battery voltage from newer devices")
Signed-off-by: default avatarTom Rix <trix@redhat.com>
Reviewed-by: default avatarFilipe Laíns <lains@riseup.net>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 31a4cf1d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment