HID: fix error message in hid_open_report()
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Fri, 23 Aug 2019 19:15:27 +0000 (21:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Nov 2019 11:18:21 +0000 (12:18 +0100)
commit3bbf6e790883b6dc0657e92960d15d52385c82ef
treee31fcaa50ef10e7b32bd495acd95af60a8d2b719
parent7b5e3ad5d582e252d971ee599a3f63f30b70ccb1
HID: fix error message in hid_open_report()

commit b3a81c777dcb093020680490ab970d85e2f6f04f upstream.

On HID report descriptor parsing error the code displays bogus
pointer instead of error offset (subtracts start=NULL from end).
Make the message more useful by displaying correct error offset
and include total buffer size for reference.

This was carried over from ancient times - "Fixed" commit just
promoted the message from DEBUG to ERROR.

Cc: stable@vger.kernel.org
Fixes: 8c3d52fc393b ("HID: make parser more verbose about parsing errors by default")
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-core.c