mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] RDMA/irdma: Remove redundant NULL check of udata in irdma_create_user_ah()
@ 2025-11-12 12:02 Tuo Li
  2025-11-12 12:20 ` Leon Romanovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Tuo Li @ 2025-11-12 12:02 UTC (permalink / raw)
  To: krzysztof.czurylo, tatyana.e.nikolova, jgg, leon
  Cc: linux-rdma, linux-kernel, Tuo Li

The variable udata cannot be NULL because irdma_create_user_ah() always
receives it. Therefore, the if() check can be safely removed.

Thank Leon Romanovsky for helpful advice.

Signed-off-by: Tuo Li <islituo@gmail.com>
---
 drivers/infiniband/hw/irdma/verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index c883c9ea5a83..a9ae5a38d03d 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -5204,7 +5204,7 @@ static int irdma_create_user_ah(struct ib_ah *ibah,
 	struct irdma_ah *parent_ah;
 	int err;
 
-	if (udata && udata->outlen < IRDMA_CREATE_AH_MIN_RESP_LEN)
+	if (udata->outlen < IRDMA_CREATE_AH_MIN_RESP_LEN)
 		return -EINVAL;
 
 	err = irdma_setup_ah(ibah, attr);
-- 
2.43.0


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

end of thread, other threads:[~2025-11-12 12:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-12 12:02 [PATCH] RDMA/irdma: Remove redundant NULL check of udata in irdma_create_user_ah() Tuo Li
2025-11-12 12:20 ` Leon Romanovsky

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

all inboxes | Powered by JetHome®