]> git.baikalelectronics.ru Git - kernel.git/commit
misc: microchip: pci1xxxx: Fix a memory leak in the error handling of gp_aux_bus_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 18 Sep 2022 06:27:33 +0000 (08:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Sep 2022 14:54:35 +0000 (16:54 +0200)
commitcb90ab0cda9ea6a19b7f5a48bfa97cba447ddccd
tree7a8cbfef7667fb94b3da61253e49ff06e50b0a51
parent5cc85f2d10548253a3a96e9333ed10ef635335c3
misc: microchip: pci1xxxx: Fix a memory leak in the error handling of gp_aux_bus_probe()

'aux_bus' is freed in the remove function but not in the error handling
path of the probe.

Use devm_kzalloc() to simplify the remove function and fix the leak in the
probe.

Fixes: 7388563b8445 ("misc: microchip: pci1xxxx: load auxiliary bus driver for the PIO function in the multi-function endpoint of pci1xxxx device.")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/17e19926669a1654e5f2495bf3b289581183d02e.1663482259.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c