WSL2-Linux-Kernel/drivers/infiniband/hw/hfi1
Zhipeng Lu 52de5805c1 IB/hfi1: Fix a memleak in init_credit_return
[ Upstream commit 809aa64ebff51eb170ee31a95f83b2d21efa32e2 ]

When dma_alloc_coherent fails to allocate dd->cr_base[i].va,
init_credit_return should deallocate dd->cr_base and
dd->cr_base[i] that allocated before. Or those resources
would be never freed and a memleak is triggered.

Fixes: 7724105686 ("IB/hfi1: add driver files")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Link: https://lore.kernel.org/r/20240112085523.3731720-1-alexious@zju.edu.cn
Acked-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-01 13:21:57 +01:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile IB/hfi1: Add functions to receive accelerated ipoib packets 2020-05-21 11:23:56 -03:00
affinity.c RDMA/hfi: Decrease PCI device reference count in error path 2022-12-31 13:14:24 +01:00
affinity.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
aspm.c IB/hfi1: Reduce excessive aspm inlines 2019-06-28 22:34:26 -03:00
aspm.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
chip.c IB/hfi1: Fix possible panic during hotplug remove 2023-08-16 18:22:01 +02:00
chip.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
chip_registers.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
common.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
debugfs.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
debugfs.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
device.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
device.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
driver.c IB/hfi1: Fix early init panic 2021-12-14 10:57:07 +01:00
efivar.c RDMA/hfi1: Workaround truncation compilation error 2023-11-20 11:08:23 +01:00
efivar.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
eprom.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
eprom.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
exp_rcv.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
exp_rcv.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
fault.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
fault.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
file_ops.c IB/hfi1: Restore allocated resources on failed copyout 2023-02-14 19:17:58 +01:00
firmware.c RDMA/hfi1: Fix error return code in parse_platform_config() 2022-12-31 13:14:26 +01:00
hfi.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
init.c RDMA/hfi1: Fix potential integer multiplication overflow errors 2022-06-09 10:23:26 +02:00
intr.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
iowait.c RDMA/hw/hfi1/iowait: Demote half-completed kernel-doc and fix formatting issue in another 2021-01-28 15:42:26 -04:00
iowait.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
ipoib.h IB/hfi1: Remove indirect call to hfi1_ipoib_send_dma() 2021-04-07 20:19:00 -03:00
ipoib_main.c IB/hfi1: Fix tstats alloc and dealloc 2022-02-08 18:34:08 +01:00
ipoib_rx.c IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
ipoib_tx.c IB/hfi1: Fix wrong mmu_node used for user SDMA packet after invalidate 2023-07-23 13:47:04 +02:00
mad.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
mad.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
mmu_rb.c IB/hfi1: Fix wrong mmu_node used for user SDMA packet after invalidate 2023-07-23 13:47:04 +02:00
mmu_rb.h IB/hfi1: Fix wrong mmu_node used for user SDMA packet after invalidate 2023-07-23 13:47:04 +02:00
msix.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
msix.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
netdev.h IB/hfi1: Rework AIP and VNIC dummy netdev usage 2021-04-13 13:54:56 -03:00
netdev_rx.c RDMA merge window pull request 2021-05-01 09:15:05 -07:00
opa_compat.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
opfn.c
opfn.h
pcie.c RDMA/hfi1: Use FIELD_GET() to extract Link Width 2023-11-28 16:56:18 +00:00
pio.c IB/hfi1: Fix a memleak in init_credit_return 2024-03-01 13:21:57 +01:00
pio.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
pio_copy.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
platform.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
platform.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
qp.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
qp.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
qsfp.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
qsfp.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
rc.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
rc.h
ruc.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
sdma.c IB/hfi1: Fix sdma.h tx->num_descs off-by-one error 2024-03-01 13:21:48 +01:00
sdma.h IB/hfi1: Fix wrong mmu_node used for user SDMA packet after invalidate 2023-07-23 13:47:04 +02:00
sdma_txreq.h IB/hfi1: Fix wrong mmu_node used for user SDMA packet after invalidate 2023-07-23 13:47:04 +02:00
sysfs.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
tid_rdma.c RDMA/hfi1: Fix typo in comments 2021-07-30 10:06:08 -03:00
tid_rdma.h IB/hfi1: Calculate flow weight based on QP MTU for TID RDMA 2019-11-06 13:15:36 -04:00
trace.c IB/hfi1: make hist static 2021-09-08 08:33:04 -03:00
trace.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
trace_ctxts.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
trace_dbg.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
trace_ibhdrs.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
trace_iowait.h
trace_misc.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
trace_mmu.h IB/hfi1: Fix bugs with non-PAGE_SIZE-end multi-iovec user SDMA requests 2023-05-11 23:00:36 +09:00
trace_rc.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
trace_rx.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
trace_tid.h treewide: Add missing semicolons to __assign_str uses 2021-06-30 09:19:14 -04:00
trace_tx.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
uc.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
ud.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
user_exp_rcv.c IB/hfi1: Assign npages earlier 2023-03-03 11:45:52 +01:00
user_exp_rcv.h IB/hfi1: Remove user expected buffer invalidate race 2023-02-01 08:27:06 +01:00
user_pages.c IB/hfi1: Fix math bugs in hfi1_can_pin_pages() 2023-03-10 09:39:43 +01:00
user_sdma.c IB/hfi1: Fix wrong mmu_node used for user SDMA packet after invalidate 2023-07-23 13:47:04 +02:00
user_sdma.h IB/hfi1: Fix wrong mmu_node used for user SDMA packet after invalidate 2023-07-23 13:47:04 +02:00
verbs.c IB/hfi1: Fix bugs with non-PAGE_SIZE-end multi-iovec user SDMA requests 2023-05-11 23:00:36 +09:00
verbs.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
verbs_txreq.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
verbs_txreq.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
vnic.h RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
vnic_main.c RDMA/hfi1: Convert to SPDX identifier 2021-08-25 14:56:48 -03:00
vnic_sdma.c IB/hfi1: Fix wrong mmu_node used for user SDMA packet after invalidate 2023-07-23 13:47:04 +02:00