summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/sunplus/sppctl.c
diff options
context:
space:
mode:
authorWilliam Dean <williamsukatube@gmail.com>2022-07-10 17:49:22 +0200
committerLinus Walleij <linus.walleij@linaro.org>2022-07-11 14:40:17 +0200
commitc3b821e8e406d5650e587b7ac624ac24e9b780a8 (patch)
treeeafcb7f951bd7f4bf04bb0097b6e1eaef4a45705 /drivers/pinctrl/sunplus/sppctl.c
parentLinux 5.19-rc6 (diff)
downloadlinux-c3b821e8e406d5650e587b7ac624ac24e9b780a8.tar.xz
linux-c3b821e8e406d5650e587b7ac624ac24e9b780a8.zip
pinctrl: ralink: Check for null return of devm_kcalloc
Because of the possible failure of the allocation, data->domains might be NULL pointer and will cause the dereference of the NULL pointer later. Therefore, it might be better to check it and directly return -ENOMEM without releasing data manually if fails, because the comment of the devm_kmalloc() says "Memory allocated with this function is automatically freed on driver detach.". Fixes: a86854d0c599b ("treewide: devm_kzalloc() -> devm_kcalloc()") Reported-by: Hacash Robot <hacashRobot@santino.com> Signed-off-by: William Dean <williamsukatube@gmail.com> Link: https://lore.kernel.org/r/20220710154922.2610876-1-williamsukatube@163.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/sunplus/sppctl.c')
0 files changed, 0 insertions, 0 deletions