hidpp20: add an assert to shut up scan-build

Not sure why it thinks we're potentially dereferencing a NULL-pointer here but
from the trace it looks like it thinks macro and a previously nullified
profile->macros are the same. They aren't, macro was just allocated here and
shouldn't be NULL if we get here.

Anyway, add an assert and move on.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2017-08-31 09:55:50 +10:00
committed by Benjamin Tissoires
parent b9f6554767
commit 83345a17d2

View File

@@ -1618,6 +1618,7 @@ hidpp20_onboard_profiles_parse_macro(struct hidpp20_device *device,
for (i = 0; i < count; i++) {
m = &macro[i];
assert(m != NULL);
switch (m->any.type) {
case HIDPP20_MACRO_DELAY:
m->delay.time = hidpp_be_u16_to_cpu(m->delay.time);