EDAC/i5100: Fix error handling order in i5100_init_one()
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Wed, 26 Aug 2020 12:14:37 +0000 (20:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 08:07:00 +0000 (09:07 +0100)
commit4024c42c6bfc3cc9ab7b18060ae16d69d4a842f9
tree55763e7f6244d3588eda7cec8b66f992fbc2ed72
parent0c1171ba3b01baf04d451535925ed7cc3d0a6b7f
EDAC/i5100: Fix error handling order in i5100_init_one()

[ Upstream commit 857a3139bd8be4f702c030c8ca06f3fd69c1741a ]

When pci_get_device_func() fails, the driver doesn't need to execute
pci_dev_put(). mci should still be freed, though, to prevent a memory
leak. When pci_enable_device() fails, the error injection PCI device
"einj" doesn't need to be disabled either.

 [ bp: Massage commit message, rename label to "bail_mc_free". ]

Fixes: 52608ba205461 ("i5100_edac: probe for device 19 function 0")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200826121437.31606-1-dinghao.liu@zju.edu.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/edac/i5100_edac.c