]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
misc: microchip: pci1xxxx: Fix a memory leak in the error handling of gp_aux_bus_probe()
authorYongzhi Liu <hyperlyzcs@gmail.com>
Thu, 23 May 2024 12:14:34 +0000 (20:14 +0800)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Fri, 2 Aug 2024 14:27:04 +0000 (16:27 +0200)
commitad8fe54737d159c4ac8951b440b54e18df6ff289
treea5c5ab673a9705ecfddd0f71323481e5e5f75b31
parent2347c712219ef05baa88c7a1a056ca1d4dfa366a
misc: microchip: pci1xxxx: Fix a memory leak in the error handling of gp_aux_bus_probe()

BugLink: https://bugs.launchpad.net/bugs/2074091
[ Upstream commit 77427e3d5c353e3dd98c7c0af322f8d9e3131ace ]

There is a memory leak (forget to free allocated buffers) in a
memory allocation failure path.

Fix it to jump to the correct error handling code.

Fixes: 393fc2f5948f ("misc: microchip: pci1xxxx: load auxiliary bus driver for the PIO function in the multi-function endpoint of pci1xxxx device.")
Signed-off-by: Yongzhi Liu <hyperlyzcs@gmail.com>
Reviewed-by: Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>
Link: https://lore.kernel.org/r/20240523121434.21855-4-hyperlyzcs@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Portia Stephens <portia.stephens@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c