diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-08-16 11:10:56 -0700 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-08-16 11:10:56 -0700 |
| commit | 13fe7056bebb4015c6231a07a1be4d3aebbfe979 (patch) | |
| tree | 8aefa59a61c081c402bc85f2b47c17e1374eabdd /drivers/input/input.c | |
| parent | MAINTAINERS: Add PhoenixRC Flight Controller Adapter (diff) | |
| parent | Input: do not use WARN() in input_alloc_absinfo() (diff) | |
| download | linux-13fe7056bebb4015c6231a07a1be4d3aebbfe979.tar.gz linux-13fe7056bebb4015c6231a07a1be4d3aebbfe979.zip | |
Merge branch 'next' into for-linus
Prepare input updates for 4.19 merge window.
Diffstat (limited to 'drivers/input/input.c')
| -rw-r--r-- | drivers/input/input.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index 6365c1958264..3304aaaffe87 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -480,11 +480,19 @@ EXPORT_SYMBOL(input_inject_event); */ void input_alloc_absinfo(struct input_dev *dev) { - if (!dev->absinfo) - dev->absinfo = kcalloc(ABS_CNT, sizeof(*dev->absinfo), - GFP_KERNEL); + if (dev->absinfo) + return; - WARN(!dev->absinfo, "%s(): kcalloc() failed?\n", __func__); + dev->absinfo = kcalloc(ABS_CNT, sizeof(*dev->absinfo), GFP_KERNEL); + if (!dev->absinfo) { + dev_err(dev->dev.parent ?: &dev->dev, + "%s: unable to allocate memory\n", __func__); + /* + * We will handle this allocation failure in + * input_register_device() when we refuse to register input + * device with ABS bits but without absinfo. + */ + } } EXPORT_SYMBOL(input_alloc_absinfo); |
