]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Input: do not use WARN() in input_alloc_absinfo()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 6 Aug 2018 22:10:40 +0000 (15:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Sep 2018 07:46:52 +0000 (09:46 +0200)
commit19f2289b4ec9e559c857727096c8d2774bda5383
tree32531663e283a9ec74cfc8d33a14e4a1472a30cc
parent4d89c871694affda9e246b15a3afed793e0c0b35
Input: do not use WARN() in input_alloc_absinfo()

[ Upstream commit 100294cee9a98bfd4d6cb2d1c8a8aef0e959b0c4 ]

Some of fuzzers set panic_on_warn=1 so that they can handle WARN()ings
the same way they handle full-blown kernel crashes. We used WARN() in
input_alloc_absinfo() to get a better idea where memory allocation
failed, but since then kmalloc() and friends started dumping call stack on
memory allocation failures anyway, so we are not getting anything extra
from WARN().

Because of the above, let's replace WARN with dev_err(). We use dev_err()
instead of simply removing message and relying on kcalloc() to give us
stack dump so that we'd know the instance of hardware device to which we
were trying to attach input device.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/input.c