forked from drath/libratbag
hidpp20: fix NULL-pointer dereference warning
rc may be a negative errno or a positive hidpp error code. If the latter we used to continue with a NULL macro pointer, eventually crashing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
committed by
Benjamin Tissoires
parent
78bdfe7a59
commit
82d197462f
@@ -1552,7 +1552,7 @@ hidpp20_onboard_profiles_parse_macro(struct hidpp20_device *device,
|
||||
int rc;
|
||||
|
||||
rc = hidpp20_onboard_profiles_read_macro(device, page, offset, ¯o);
|
||||
if (rc < 0)
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
count = rc;
|
||||
|
||||
Reference in New Issue
Block a user