1
0
Fork 0
remarkable-linux/drivers/pinctrl
Wei Yongjun b6fadd93ad pinctrl: nsp: Fix potential NULL dereference
[ Upstream commit c29e9da56b ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-24 13:09:17 +02:00
..
aspeed pinctrl: aspeed: Rework strap register write logic for the AST2500 2017-08-31 13:39:38 +02:00
bcm pinctrl: nsp: Fix potential NULL dereference 2018-08-24 13:09:17 +02:00
berlin pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00
freescale License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
intel Revert "pinctrl: intel: Initialize GPIO properly when used through irqchip" 2018-04-29 11:33:09 +02:00
mediatek License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
meson pinctrl: meson-gxl: add tsin_a pins 2017-06-16 11:08:49 +02:00
mvebu pinctrl: armada-37xx: Fix direction_output() callback behavior 2017-12-14 09:52:49 +01:00
nomadik License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pxa pinctrl: pxa: pxa2xx: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE 2018-02-07 11:12:20 -08:00
qcom Revert "pinctrl: msm: Use dynamic GPIO numbering" 2018-06-05 11:41:55 +02:00
samsung pinctrl: samsung: Correct EINTG banks order 2018-07-03 11:24:56 +02:00
sh-pfc pinctrl: sh-pfc: r8a7796: Fix MOD_SEL register pin assignment for SSI pins group 2018-05-30 07:52:39 +02:00
sirf pinctrl: sirf: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:39:08 +02:00
spear License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sprd pinctrl: sprd: fix off by one bugs 2017-09-12 11:27:36 +02:00
stm32 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sunxi pinctrl: sunxi: Fix A64 UART mux value 2018-02-25 11:07:56 +01:00
tegra License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ti pinctrl: ti-iodelay: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:42:48 +02:00
uniphier License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vt8500 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
zte pinctrl: zte: fix 'functions' allocation in zx_pinctrl_build_state() 2017-08-14 15:01:01 +02:00
Kconfig pinctrl: adi2: Fix Kconfig build problem 2017-12-20 10:10:34 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
core.c pinctrl: Really force states during suspend/resume 2018-03-24 11:01:26 +01:00
core.h pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00
devicetree.c pinctrl: devicetree: Fix pctldev pointer overwrite 2018-07-03 11:24:56 +02:00
devicetree.h pinctrl: core: Use delayed work for hogs 2017-01-03 09:26:16 +01:00
pinconf-generic.c pinctrl: Add sleep related state to indicate sleep related configs 2017-08-31 09:15:21 +02:00
pinconf.c pinctrl: check ops->pin_config_set in pinconf_set_config() 2017-08-14 15:01:59 +02:00
pinconf.h pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00
pinctrl-adi2-bf54x.c pinctrl: pinctrl-adi: combine multiple groups of one function together 2014-02-25 10:49:13 +01:00
pinctrl-adi2-bf60x.c added tabs instead of spaces 2015-07-16 09:39:01 +02:00
pinctrl-adi2.c pinctrl: adi2: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:40:45 +02:00
pinctrl-adi2.h pinctrl: pinctrl-adi: combine multiple groups of one function together 2014-02-25 10:49:13 +01:00
pinctrl-amd.c pinctrl/amd: fix masking of GPIO interrupts 2017-10-19 10:19:46 +02:00
pinctrl-amd.h pinctrl/amd: save pin registers over suspend/resume 2017-09-12 15:58:45 +02:00
pinctrl-artpec6.c pinctrl: artpec6: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:36:59 +02:00
pinctrl-as3722.c pinctrl: as3722: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 09:23:21 +02:00
pinctrl-at91-pio4.c pinctrl: at91-pio4: add missing of_node_put 2018-08-03 07:50:31 +02:00
pinctrl-at91.c pinctrl: at91: add support for OUTPUT config 2016-10-31 09:16:46 +01:00
pinctrl-at91.h pinctrl: at91: use own header 2014-10-29 09:28:35 +01:00
pinctrl-coh901.c pinctrl: coh901: constify gpio_chip structure 2017-08-14 15:00:59 +02:00
pinctrl-coh901.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pinctrl-da850-pupd.c Merge branch 'ib-pinctrl-genprops' into devel 2017-01-26 15:27:54 +01:00
pinctrl-digicolor.c pinctrl: digicolor: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:39:36 +02:00
pinctrl-falcon.c pinctrl: update my email address 2016-12-30 09:17:02 +01:00
pinctrl-gemini.c pinctrl: add a Gemini SoC pin controller 2017-08-14 15:01:59 +02:00
pinctrl-ingenic.c pinctrl: ingenic: Fix inverted direction for < JZ4770 2018-08-24 13:09:17 +02:00
pinctrl-lantiq.c pinctrl: update my email address 2016-12-30 09:17:02 +01:00
pinctrl-lantiq.h pinctrl: update my email address 2016-12-30 09:17:02 +01:00
pinctrl-lpc18xx.c pinctrl: Widen the generic pinconf argument from 16 to 24 bits 2017-01-26 15:22:32 +01:00
pinctrl-max77620.c pinctrl: Widen the generic pinconf argument from 16 to 24 bits 2017-01-26 15:22:32 +01:00
pinctrl-mcp23s08.c pinctrl: mcp23s08: spi: Fix regmap debugfs entries 2018-05-30 07:52:41 +02:00
pinctrl-oxnas.c pinctrl: oxnas: Add support for OX820 2016-10-24 16:30:14 +02:00
pinctrl-palmas.c pinctrl: Widen the generic pinconf argument from 16 to 24 bits 2017-01-26 15:22:32 +01:00
pinctrl-pic32.c pinctrl: pic32: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 09:23:24 +02:00
pinctrl-pic32.h pinctrl: pinctrl-pic32: Add PIC32 pin control driver 2016-02-05 23:54:47 +01:00
pinctrl-pistachio.c pinctrl: pistachio: fix mfio pll_lock pinmux 2016-08-22 15:28:35 +02:00
pinctrl-rk805.c pinctrl: Add pinctrl driver for the RK805 PMIC 2017-08-21 08:54:46 +01:00
pinctrl-rockchip.c pinctrl: rockchip: enable clock when reading pin direction register 2018-03-24 11:01:26 +01:00
pinctrl-rza1.c pinctrl: rza1: Remove suffix from gpiochip label 2017-08-31 14:45:18 +02:00
pinctrl-single.c pinctrl: single: use of_device_get_match_data() to get soc data 2017-05-29 10:18:46 +02:00
pinctrl-st.c pinctrl: st: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:38:03 +02:00
pinctrl-sx150x.c pinctrl: sx150x: Add a static gpio/pinctrl pin range mapping 2018-02-16 20:23:08 +01:00
pinctrl-tb10x.c pinctrl: tb10x: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:41:40 +02:00
pinctrl-tz1090-pdc.c pinctrl: tz1090-pdc: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:42:00 +02:00
pinctrl-tz1090.c pinctrl: tz1090: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures 2017-08-22 14:42:19 +02:00
pinctrl-u300.c pinctrl: u300: make u300_pmx_registers static 2016-06-13 09:27:43 +02:00
pinctrl-utils.c pinctrl: Rename pinctrl_utils_dt_free_map to pinctrl_utils_free_map 2016-04-01 15:06:36 +02:00
pinctrl-utils.h pinctrl: Rename pinctrl_utils_dt_free_map to pinctrl_utils_free_map 2016-04-01 15:06:36 +02:00
pinctrl-xway.c pinctrl: xway: fix copy/paste error in xrx200_grps 2017-05-29 18:46:42 +02:00
pinctrl-zynq.c pinctrl: zynq: Fix warnings in the driver 2017-08-14 15:01:01 +02:00
pinmux.c pinctrl: add __rcu annotations to fix sparse warnings 2017-08-14 15:01:59 +02:00
pinmux.h pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00