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

Tuo Li posted 1 patch 2 months, 3 weeks ago
drivers/infiniband/hw/irdma/verbs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] RDMA/irdma: Remove redundant NULL check of udata in irdma_create_user_ah()
Posted by Tuo Li 2 months, 3 weeks ago
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
Re: [PATCH] RDMA/irdma: Remove redundant NULL check of udata in irdma_create_user_ah()
Posted by Leon Romanovsky 2 months, 3 weeks ago
On Wed, 12 Nov 2025 20:02:53 +0800, Tuo Li wrote:
> 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,
-- 
Leon Romanovsky <leonro@nvidia.com>