From 83345a17d231e12e06f0bc38f662911448f1039b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 31 Aug 2017 09:55:50 +1000 Subject: [PATCH] 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 --- src/hidpp20.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hidpp20.c b/src/hidpp20.c index 3618d116..72c9ec04 100644 --- a/src/hidpp20.c +++ b/src/hidpp20.c @@ -1618,6 +1618,7 @@ hidpp20_onboard_profiles_parse_macro(struct hidpp20_device *device, for (i = 0; i < count; i++) { m = ¯o[i]; + assert(m != NULL); switch (m->any.type) { case HIDPP20_MACRO_DELAY: m->delay.time = hidpp_be_u16_to_cpu(m->delay.time);