kernel_optimize_test/drivers/pinctrl
Yang Yingliang 46709163a5 pinctrl: core: fix possible memory leak in pinctrl_enable()
commit c7892ae13e461ed20154321eb792e07ebe38f5b3 upstream.

I got memory leak as follows when doing fault injection test:

unreferenced object 0xffff888020a7a680 (size 64):
  comm "i2c-mcp23018-41", pid 23090, jiffies 4295160544 (age 8.680s)
  hex dump (first 32 bytes):
    00 48 d3 1e 80 88 ff ff 00 1a 56 c1 ff ff ff ff  .H........V.....
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000083c79b35>] kmem_cache_alloc_trace+0x16d/0x360
    [<0000000051803c95>] pinctrl_init_controller+0x6ed/0xb70
    [<0000000064346707>] pinctrl_register+0x27/0x80
    [<0000000029b0e186>] devm_pinctrl_register+0x5b/0xe0
    [<00000000391f5a3e>] mcp23s08_probe_one+0x968/0x118a [pinctrl_mcp23s08]
    [<000000006112c039>] mcp230xx_probe+0x266/0x560 [pinctrl_mcp23s08_i2c]

If pinctrl_claim_hogs() fails, the 'pindesc' allocated in pinctrl_register_one_pin()
need be freed.

Cc: stable@vger.kernel.org
Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 950b0d91dc ("pinctrl: core: Fix regression caused by delayed work for hogs")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20211022014323.1156924-1-yangyingliang@huawei.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-18 14:03:51 +01:00
..
actions pinctrl: remove empty lines in pinctrl subsystem 2021-09-18 13:40:11 +02:00
aspeed
bcm Revert "pinctrl: bcm: ns: support updated DT binding as syscon subnode" 2021-11-02 19:48:19 +01:00
berlin
cirrus
freescale pinctrl: remove empty lines in pinctrl subsystem 2021-09-18 13:40:11 +02:00
intel pinctrl: tigerlake: Fix GPIO mapping for newer version of software 2021-08-18 08:59:09 +02:00
mediatek pinctrl: mediatek: Fix fallback behavior for bias_set_combo 2021-08-18 08:59:08 +02:00
meson
mvebu pinctrl: armada-37xx: Correct PWM pins definitions 2021-09-18 13:40:11 +02:00
nomadik
nuvoton
pxa
qcom pinctrl: remove empty lines in pinctrl subsystem 2021-09-18 13:40:11 +02:00
renesas pinctrl: remove empty lines in pinctrl subsystem 2021-09-18 13:40:11 +02:00
samsung pinctrl: samsung: Fix pinctrl bank pin count 2021-09-18 13:40:12 +02:00
sirf
spear
sprd
stm32 pinctrl: stm32: use valid pin identifier in stm32_pinctrl_resume() 2021-10-27 09:56:56 +02:00
sunxi
tegra
ti
uniphier
visconti
vt8500
zte
core.c pinctrl: core: fix possible memory leak in pinctrl_enable() 2021-11-18 14:03:51 +01:00
core.h
devicetree.c
devicetree.h
Kconfig
Makefile
pinconf-generic.c
pinconf.c
pinconf.h
pinctrl-amd.c pinctrl: amd: disable and mask interrupts on probe 2021-11-02 19:48:19 +01:00
pinctrl-amd.h
pinctrl-artpec6.c
pinctrl-as3722.c
pinctrl-at91-pio4.c
pinctrl-at91.c pinctrl: remove empty lines in pinctrl subsystem 2021-09-18 13:40:11 +02:00
pinctrl-at91.h
pinctrl-axp209.c
pinctrl-bm1880.c
pinctrl-coh901.c
pinctrl-coh901.h
pinctrl-da850-pupd.c
pinctrl-da9062.c
pinctrl-digicolor.c
pinctrl-equilibrium.c pinctrl: equilibrium: Add missing MODULE_DEVICE_TABLE 2021-07-19 09:44:40 +02:00
pinctrl-equilibrium.h
pinctrl-falcon.c
pinctrl-gemini.c
pinctrl-ingenic.c pinctrl: ingenic: Fix incorrect pull up/down info 2021-09-18 13:40:07 +02:00
pinctrl-lantiq.c
pinctrl-lantiq.h
pinctrl-lpc18xx.c
pinctrl-max77620.c
pinctrl-mcp23s08_i2c.c
pinctrl-mcp23s08_spi.c
pinctrl-mcp23s08.c pinctrl: mcp23s08: Fix missing unlock on error in mcp23s08_irq() 2021-07-19 09:45:02 +02:00
pinctrl-mcp23s08.h
pinctrl-ocelot.c
pinctrl-oxnas.c
pinctrl-palmas.c
pinctrl-pic32.c
pinctrl-pic32.h
pinctrl-pistachio.c
pinctrl-rk805.c
pinctrl-rockchip.c
pinctrl-single.c pinctrl: single: Fix error return code in pcs_parse_bits_in_pinctrl_entry() 2021-09-18 13:40:14 +02:00
pinctrl-st.c pinctrl: remove empty lines in pinctrl subsystem 2021-09-18 13:40:11 +02:00
pinctrl-stmfx.c pinctrl: stmfx: Fix hazardous u8[] to unsigned long cast 2021-09-18 13:40:07 +02:00
pinctrl-sx150x.c pinctrl: remove empty lines in pinctrl subsystem 2021-09-18 13:40:11 +02:00
pinctrl-tb10x.c
pinctrl-u300.c
pinctrl-utils.c
pinctrl-utils.h
pinctrl-xway.c
pinctrl-zynq.c
pinmux.c
pinmux.h