[PATCH] HID: core: demote warning to debug level

Ben Hutchings <[email protected]>
Newsgroups org.kernel.vger.linux-input,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
From: Matteo Croce <[email protected]>

The log level for short  messages was changed from debug to warning,
flooding syslog on systems with devices that regularly send
short reports, in my case an UPS:

    $ dmesg |grep -c 'Event data for report .* was too short'
    35

Demote it back to debug level.

Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
Signed-off-by: Matteo Croce <[email protected]>
[bwh: Re-sending this fix which was applied and then lost in a mis-
 merge.  Add a second Fixes trailer so this should reach all stable
 branches that have the warning.]
Fixes: 2c85c61d1332 ("HID: pass the buffer size to hid_report_raw_event")
Cc: [email protected]
Signed-off-by: Ben Hutchings <[email protected]>
---
This was originally posted at
<https://lore.kernel.org/linux-input/[email protected]/>
and applied to the hid tree as commit d0ff08d946c8, but then it was
lost in merge commit aa776949fb77 "Merge branch 'for-7.2/wiimote' into
for-linus".

Ben.

 drivers/hid/hid-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index cf123347a2af..605530ec2e9c 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -2079,8 +2079,8 @@ int hid_report_raw_event(struct hid_device *hid, enum hid_report_type type, u8 *
 		rsize = max_buffer_size;
 
 	if (bsize < rsize) {
-		hid_warn_ratelimited(hid, "Event data for report %d was too short (%d vs %zu)\n",
-				     report->id, rsize, bsize);
+		hid_dbg_ratelimited(hid, "Event data for report %d was too short (%d vs %zu)\n",
+				    report->id, rsize, bsize);
 		return -EINVAL;
 	}
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEErCspvTSmr92z9o8157/I7JWGEQkFAmqBfowACgkQ57/I7JWG
EQm/bA/+NYBTqjjxmY8NP259zAuvFQJoR61XfIcj2NImqh/lotA/uAqeS1g6q46u
GgHlbfOhwjEwoMYQDLeChmaFSxZZCbYhd4ZQMruFodRd2NDwlMlQi6Jq8Umu3NJq
kQvVCHX0JEaOcoTKnhxEqJ7ssfrZwBUDixupDvlvu3kcBEsA7lp7MR7G5hkwrKVd
015y70C20LkQIif+e4D7FMqZI8Fq6yxga8qq/j50Kqo8vpygkMW8RwSwS9XHP8go
N7+YYidSoVfHoATNIWMU8iMxNaf+lnD3lYz7hxJkoTK2+A3c46YY+8rs27LOEHc6
qN0DQxJrx9LKzeMp3YPCtG4nbOCa7kPx98dWy5s9u5wrVAXjgMQ/Hztwr0qHpEHi
6VyREG+DqzFu2EEIlpFga4L1uxmkKgKIZ6gUrRdoHt933ag5LqrCInVQZVM3jhwY
mqWkk0dAXpBortytqEItyhVBmFN9WIb71IFBcDUoj3K3pUZszefchO29gvpJJUYr
DgPetpQxXYbA8/NR9jzznuDzIMOsN44tgqSg4wWHsMNc7KFQgcTrmfG4zU8+rhAM
Hqqdp8vWPf9ZH1GfjvvjSyA2oyRyRp/KceqwHGlU67VAlfiZdW0HD3W6K39CQCiJ
GS9igvKA+tyZZwnMpfGx4VD24PkswFU+scAJa7KfwNbOBeR478M=
=R7bY
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.