WSL2-Linux-Kernel/drivers/pinctrl/bcm
Wei Yongjun c29e9da56b pinctrl: nsp: Fix potential NULL dereference
platform_get_resource() may fail and return NULL, so we should
better check it's return value to avoid a NULL pointer dereference
a bit later in the code.

This is detected by Coccinelle semantic patch.

@@
expression pdev, res, n, t, e, e1, e2;
@@

res = platform_get_resource(pdev, t, n);
+ if (!res)
+   return -EINVAL;
... when != res == NULL
e = devm_ioremap_nocache(e1, res->start, e2);

Fixes: cc4fa83f66 ("pinctrl: nsp: add pinmux driver support for Broadcom NSP SoC")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2018-07-14 12:47:04 +02:00
..
Kconfig pinctrl: bcm2835: Add support for generic pinctrl binding 2018-05-16 14:00:00 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pinctrl-bcm281xx.c pinctrl: bcm281xx: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:36:25 +02:00
pinctrl-bcm2835.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
pinctrl-cygnus-mux.c pinctrl: bcm: cleanup Broadcom license headers 2017-06-09 11:09:43 +02:00
pinctrl-iproc-gpio.c Merge branch 'gpio-irqchip-rework' of /home/linus/linux-gpio into devel 2017-11-09 09:38:42 +01:00
pinctrl-ns2-mux.c pinctrl: Widen the generic pinconf argument from 16 to 24 bits 2017-01-26 15:22:32 +01:00
pinctrl-nsp-gpio.c pinctrl: bcm: nsp: Use library functions 2017-10-07 00:00:13 +02:00
pinctrl-nsp-mux.c pinctrl: nsp: Fix potential NULL dereference 2018-07-14 12:47:04 +02:00