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:
Peter Hutterer
2017-07-10 15:32:49 +10:00
committed by Benjamin Tissoires
parent 78bdfe7a59
commit 82d197462f

View File

@@ -1552,7 +1552,7 @@ hidpp20_onboard_profiles_parse_macro(struct hidpp20_device *device,
int rc;
rc = hidpp20_onboard_profiles_read_macro(device, page, offset, &macro);
if (rc < 0)
if (rc)
return rc;
count = rc;