summaryrefslogtreecommitdiff
path: root/drivers/staging/nvec
diff options
context:
space:
mode:
authorXidong Wang <wangxidong_97@163.com>2019-12-18 13:56:38 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-19 19:23:29 +0100
commita5a98554206651b25d84a25b49eeac31dffbe358 (patch)
tree06f3cf2e666c54649bcea814f314a553e49f8011 /drivers/staging/nvec
parent6db45b06611ce8ebae6952e249257bd45d980ed4 (diff)
staging: nvec: check return value
In nvec_kbd_probe(), the return value of devm_input_allocate_device() should be checked before it is used. Signed-off-by: Xidong Wang <wangxidong_97@163.com> Link: https://lore.kernel.org/r/1576648598-12257-1-git-send-email-wangxidong_97@163.com Acked-by: Marc Dietrich <marvin24@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/nvec')
-rw-r--r--drivers/staging/nvec/nvec_kbd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/nvec/nvec_kbd.c b/drivers/staging/nvec/nvec_kbd.c
index 01dbb66f7e9a..386d619e3ee9 100644
--- a/drivers/staging/nvec/nvec_kbd.c
+++ b/drivers/staging/nvec/nvec_kbd.c
@@ -123,6 +123,8 @@ static int nvec_kbd_probe(struct platform_device *pdev)
keycodes[j++] = extcode_tab_us102[i];
idev = devm_input_allocate_device(&pdev->dev);
+ if (!idev)
+ return -ENOMEM;
idev->name = "nvec keyboard";
idev->phys = "nvec";
idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) | BIT_MASK(EV_LED);