Skip to contentSkip to conversation

RDMA/irdma: Remove redundant NULL check of udata in irdma_create_user_ah()

PATCH Applied Tuo Li 2 participants 2 messages Nov 12, 2025

Subsystems (2)
lore
Share & tools
lore

Tuo Li

author
#0 lore raw

PATCH 1/1 RDMA/irdma: Remove redundant NULL check of udata in irdma_create_user_ah()

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.

---
 drivers/infiniband/hw/irdma/verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/irdma/verbs.c +1 -1
index c883c9ea5a83..a9ae5a38d03d 100644
@@ -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);
Signature · 1 line
2.43.0
maintainer Applied
#1 lore raw
Quoted 6 lines · 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.

Applied, thanks!

[1/1] RDMA/irdma: Remove redundant NULL check of udata in irdma_create_user_ah()
(no commit info)

Best regards,

Signature · 1 line
Leon Romanovsky <[email protected]>