WSL2-Linux-Kernel/drivers/pinctrl
Sean Wang 181cdac02c pinctrl: mediatek: mt7622: fix potential uninitialized value being returned
commit d6ed935513 ("pinctrl: mediatek: add pinctrl driver for MT7622
SoC") leads to the following static checker warning:

drivers/pinctrl/mediatek/pinctrl-mt7622.c:1419 mtk_gpio_get()
error: uninitialized symbol 'value'.
1412  static int mtk_gpio_get(struct gpio_chip *chip, unsigned int gpio)
1413  {
1414          struct mtk_pinctrl *hw = dev_get_drvdata(chip->parent);
1415          int value;
1416
1417          mtk_hw_get_value(hw, gpio, PINCTRL_PIN_REG_DI, &value);
^^^^^^^^^^^^^^^^
1418
1419          return !!value;
1420  }

The appropriate error handling must be added to avoid the potential error
caused by uninitialized value being returned.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2018-01-11 10:42:12 +01:00
..
aspeed pinctrl: aspeed: Rework strap register write logic for the AST2500 2017-08-31 13:39:38 +02:00
bcm This is the bulk of pin control changes for the v4.15 2017-11-16 10:57:11 -08:00
berlin pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00
freescale pinctrl: imx7ulp: constify struct imx_cfg_params_decode 2018-01-11 10:29:40 +01:00
intel pinctrl: baytrail: Enable glitch filter for GPIOs used as interrupts 2018-01-08 08:15:46 +01:00
mediatek pinctrl: mediatek: mt7622: fix potential uninitialized value being returned 2018-01-11 10:42:12 +01:00
meson pinctrl: meson-axg: adjust spicc pin naming 2017-12-13 00:52:49 +01:00
mvebu pinctrl: armada-37xx: account for const type of of_device_id.data 2018-01-08 08:15:48 +01:00
nomadik pinctrl/nomadik/abx500: Improve a size determination in abx500_gpio_probe() 2017-12-21 10:20:29 +01:00
pxa pinctrl: pxa: pxa2xx: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE 2017-11-30 14:42:04 +01:00
qcom pinctrl: qcom: Add msm8998 pinctrl driver 2018-01-09 15:30:20 +01:00
samsung pinctrl: samsung: Add SPDX license identifiers 2018-01-03 08:46:54 +01:00
sh-pfc pinctrl: sh-pfc: r8a7795: Add SATA pins, groups, and functions 2017-12-21 10:08:23 +01:00
sirf Merge branch 'gpio-irqchip-rework' of /home/linus/linux-gpio into devel 2017-11-09 09:38:42 +01:00
spear pinctrl: spear: Delete an error message for a failed memory allocation in spear_pinctrl_probe() 2018-01-03 08:46:55 +01:00
sprd pinctrl: sprd: fix off by one bugs 2017-09-12 11:27:36 +02:00
stm32 pinctrl: stm32: Add STM32MP157 MPU support 2017-12-20 08:36:22 +01:00
sunxi pinctrl: sunxi-pinctrl: fix pin funtion can not be match correctly. 2018-01-10 14:44:20 +01:00
tegra pinctrl: tegra: Delete two error messages for a failed memory allocation in tegra_pinctrl_probe() 2018-01-03 08:46:55 +01:00
ti pinctrl: ti-iodelay: remove redundant unused variable dev 2017-11-08 13:49:57 +01:00
uniphier pinctrl: uniphier: refactor drive strength get/set functions 2018-01-11 10:40:23 +01:00
vt8500 pinctrl: vt8500: Delete an error message for a failed memory allocation in five functions 2018-01-08 08:15:46 +01:00
zte pinctrl: zte: fix 'functions' allocation in zx_pinctrl_build_state() 2017-08-14 15:01:01 +02:00
Kconfig pinctrl: Add Microsemi Ocelot SoC driver 2018-01-09 14:54:59 +01:00
Makefile pinctrl: Add Microsemi Ocelot SoC driver 2018-01-09 14:54:59 +01:00
core.c pinctrl: Really force states during suspend/resume 2017-12-20 08:24:13 +01:00
core.h pinctrl/gpio: Unify namespace for cross-calls 2017-09-22 11:02:10 +02:00
devicetree.c pinctrl: Delete an error message 2017-08-31 15:45:29 +02:00
devicetree.h
pinconf-generic.c pinctrl: Add skew-delay pin config and bindings 2017-11-08 13:49:45 +01: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-adi2-bf60x.c
pinctrl-adi2.c pinctrl: adi2: Improve a size determination in two functions 2017-12-21 10:22:41 +01:00
pinctrl-adi2.h
pinctrl-amd.c This is the bulk of pin control changes for the v4.15 2017-11-16 10:57:11 -08: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-at91-pio4.c pinctrl: at91-pio4: account for const type of of_device_id.data 2018-01-08 08:15:47 +01:00
pinctrl-at91.c pinctrl: at91: Delete an error message for a failed memory allocation in at91_pinctrl_mux_mask() 2018-01-03 08:46:49 +01:00
pinctrl-at91.h
pinctrl-axp209.c pinctrl: axp209: account for const type of of_device_id.data 2018-01-08 08:15:47 +01:00
pinctrl-coh901.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01: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
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-gemini.c pinctrl: gemini: Support drive strength setting 2017-12-07 09:59:26 +01:00
pinctrl-ingenic.c pinctrl: ingenic: make function ingenic_pinctrl_probe static 2017-10-09 23:01:48 +02:00
pinctrl-lantiq.c
pinctrl-lantiq.h
pinctrl-lpc18xx.c
pinctrl-max77620.c pinctrl: max77620: Use common error handling code in max77620_pinconf_set() 2017-11-08 13:49:57 +01:00
pinctrl-mcp23s08.c pinctrl: mcp23s08: Combine two function calls into one in mcp23s08_dbg_show() 2018-01-09 15:10:02 +01:00
pinctrl-ocelot.c pinctrl: Add Microsemi Ocelot SoC driver 2018-01-09 14:54:59 +01:00
pinctrl-oxnas.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
pinctrl-palmas.c pinctrl: palmas: Delete an error message for a failed memory allocation in palmas_pinctrl_probe() 2018-01-03 08:46:49 +01:00
pinctrl-pic32.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
pinctrl-pic32.h
pinctrl-pistachio.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01: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: Fix a typo in four comment lines 2018-01-03 08:46:51 +01:00
pinctrl-rza1.c pinctrl: rza1: Add support for RZ/A1L 2017-10-09 09:16:21 +02:00
pinctrl-single.c pinctrl: single: Delete an unnecessary return statement in pcs_irq_chain_handler() 2018-01-03 08:46:51 +01:00
pinctrl-st.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
pinctrl-sx150x.c Merge branch 'gpio-irqchip-rework' of /home/linus/linux-gpio into devel 2017-11-09 09:38:42 +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: Delete an error message for a failed memory allocation in two functions 2018-01-03 08:46:52 +01:00
pinctrl-tz1090.c pinctrl: tz1090: Delete an error message for a failed memory allocation in two functions 2018-01-03 08:46:52 +01:00
pinctrl-u300.c
pinctrl-utils.c pinctrl: utils: Delete an error message for a failed memory allocation in pinctrl_utils_add_map_configs() 2018-01-03 08:46:53 +01:00
pinctrl-utils.h
pinctrl-xway.c pinctrl: xway: Delete two error messages for a failed memory allocation in pinmux_xway_probe() 2018-01-03 08:46:53 +01:00
pinctrl-zynq.c pinctrl: zynq: Fix warnings in the driver 2017-08-14 15:01:01 +02:00
pinmux.c pinctrl: remove redundant mux_setting clear in pinmux_disable_setting() 2018-01-09 14:48:34 +01:00
pinmux.h pinctrl: move const qualifier before struct 2017-08-14 15:01:02 +02:00