]> git.baikalelectronics.ru Git - kernel.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)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 8 Aug 2018 18:23:47 +0000 (11:23 -0700)
commit70ecbbb83729c2d21ab683368951e27c855676de
treebbcc4b62c252897be5c4fdb6b8f64e1ce10b1361
parent63782af7db3e6a57da121b9a72d870487cda95f1
Input: do not use WARN() in input_alloc_absinfo()

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>
drivers/input/input.c