public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-next] RDMA/rxe: rxe_get_av always receives ahp hence no put is needed
@ 2022-10-20 15:13 Md Haris Iqbal
  2022-10-21  5:58 ` Bob Pearson
  2022-10-26  9:37 ` [kbuild] " Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Md Haris Iqbal @ 2022-10-20 15:13 UTC (permalink / raw)
  To: linux-rdma; +Cc: leon, jgg, haris.iqbal, Md Haris Iqbal

The function rxe_get_av is only used by rxe_requester, and the ahp double
pointer is always sent. Hence there is no need to do the check.
rxe_requester also always performs the put for ah, hence that is also not
needed.

Signed-off-by: Md Haris Iqbal <haris.phnx@gmail.com>
---
 drivers/infiniband/sw/rxe/rxe_av.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_av.c b/drivers/infiniband/sw/rxe/rxe_av.c
index 3b05314ca739..0780ffcf24a6 100644
--- a/drivers/infiniband/sw/rxe/rxe_av.c
+++ b/drivers/infiniband/sw/rxe/rxe_av.c
@@ -130,11 +130,7 @@ struct rxe_av *rxe_get_av(struct rxe_pkt_info *pkt, struct rxe_ah **ahp)
 			rxe_put(ah);
 			return NULL;
 		}
-
-		if (ahp)
-			*ahp = ah;
-		else
-			rxe_put(ah);
+		*ahp = ah;
 
 		return &ah->av;
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-26  9:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-20 15:13 [PATCH for-next] RDMA/rxe: rxe_get_av always receives ahp hence no put is needed Md Haris Iqbal
2022-10-21  5:58 ` Bob Pearson
2022-10-26  9:37 ` [kbuild] " Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox