From: Peter Wu Date: Thu, 11 Dec 2014 12:51:18 +0000 (+0100) Subject: HID: logitech-hidpp: check name retrieval return code X-Git-Tag: omap-for-v3.20/drop-legacy-3517~109^2^5~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1430ee73b566a30bc210501d1e0e99c519707f1e;p=pandora-kernel.git HID: logitech-hidpp: check name retrieval return code hidpp_devicenametype_get_device_name() may return a negative value on protocol errors (for example, when the device is powered off). Explicitly check this condition to avoid a long-running loop. (0 cannot be returned as __name_length - index > 0, but check for it anyway as it would otherwise result in an infinite loop.) Signed-off-by: Peter Wu Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina --- Reading git-diff-tree failed