]> git.baikalelectronics.ru Git - kernel.git/commit
IB/hfi1: Fix expected receive setup error exit issues
authorDean Luick <dean.luick@cornelisnetworks.com>
Mon, 9 Jan 2023 17:31:21 +0000 (12:31 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Feb 2023 06:52:36 +0000 (07:52 +0100)
commita7c884c4055943c5e1b1a01ba8990354f33c1931
treeb8ca40b068838425efdfb652a88c79f31a438865
parent55c530a7b039866d44d08d5c4844132c85f4a84c
IB/hfi1: Fix expected receive setup error exit issues

[ Upstream commit e0c4a422f5246abefbf7c178ef99a1f2dc3c5f62 ]

Fix three error exit issues in expected receive setup.
Re-arrange error exits to increase readability.

Issues and fixes:
1. Possible missed page unpin if tidlist copyout fails and
   not all pinned pages where made part of a TID.
   Fix: Unpin the unused pages.

2. Return success with unset return values tidcnt and length
   when no pages were pinned.
   Fix: Return -ENOSPC if no pages were pinned.

3. Return success with unset return values tidcnt and length when
   no rcvarray entries available.
   Fix: Return -ENOSPC if no rcvarray entries are available.

Fixes: 032fa89ceb9c ("staging/hfi1: Add TID entry program function body")
Fixes: 93dce2839fc9 ("IB/hfi1: Validate page aligned for a given virtual addres")
Fixes: 5171fa112b17 ("IB/hfi1: Refactor hfi_user_exp_rcv_setup() IOCTL")
Signed-off-by: Dean Luick <dean.luick@cornelisnetworks.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Link: https://lore.kernel.org/r/167328548150.1472310.1492305874804187634.stgit@awfm-02.cornelisnetworks.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hfi1/user_exp_rcv.c