]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
PCI: endpoint: pci-epf-vntb: fix error handle in epf_ntb_mw_bar_init()
authorYang Yingliang <yangyingliang@huawei.com>
Sat, 25 Jun 2022 02:15:16 +0000 (10:15 +0800)
committerJon Mason <jdmason@kudzu.us>
Tue, 9 Aug 2022 21:54:40 +0000 (17:54 -0400)
commit8e4bfbe644a6b804a72fd4575d89507a6e1d9476
tree067a10f62c62baefe3105b18c12b623666286a01
parent556a2c7dca337954040ffdf0c544aa8bbb75583b
PCI: endpoint: pci-epf-vntb: fix error handle in epf_ntb_mw_bar_init()

In error case of epf_ntb_mw_bar_init(), memory window BARs should be
cleared, so add 'num_mws' parameter in epf_ntb_mw_bar_clear() and
calling it in error path to clear the BARs. Also add missing error
code when pci_epc_mem_alloc_addr() fails.

Fixes: ff32fac00d97 ("NTB: EPF: support NTB transfer between PCI RC and EP connection")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/pci/endpoint/functions/pci-epf-vntb.c