]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
pinctrl:sunplus: Add check for kmalloc
authorWells Lu <wellslutw@gmail.com>
Sun, 28 May 2023 12:34:37 +0000 (20:34 +0800)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:19:49 +0000 (17:19 +0200)
commit307020a75df20ab3259561ded6892ad1728576d9
tree1f8d7d2752a86fdfc810c2f7324ff296c3bbda85
parentb1f658c11cc87bd65e124e32d5840de44c029887
pinctrl:sunplus: Add check for kmalloc

BugLink: https://bugs.launchpad.net/bugs/2034469
[ Upstream commit 73f8ce7f961afcb3be49352efeb7c26cc1c00cc4 ]

Fix Smatch static checker warning:
potential null dereference 'configs'. (kmalloc returns null)

Changes in v2:
1. Add free allocated memory before returned -ENOMEM.
2. Add call of_node_put() before returned -ENOMEM.

Fixes: aa74c44be19c ("pinctrl: Add driver for Sunplus SP7021")
Signed-off-by: Wells Lu <wellslutw@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/1685277277-12209-1-git-send-email-wellslutw@gmail.com
[Rebased on the patch from Lu Hongfei]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/pinctrl/sunplus/sppctl.c