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>
This commit is contained in:
Xidong Wang 2019-12-18 13:56:38 +08:00 committed by Greg Kroah-Hartman
parent 6db45b0661
commit a5a9855420
1 changed files with 2 additions and 0 deletions

View File

@ -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);