From 28c090204b4dd9ea769ce4715e6f85ceb0d972d1 Mon Sep 17 00:00:00 2001 From: Mukesh Kacker Date: Thu, 27 Oct 2016 06:07:16 -0700 Subject: [PATCH] mlx4_ib: remove WARN_ON() based on incorrect assumptions A WARN_ON() was inserted when user data was introduced to the ibv_cmd_alloc_shpd() by another infiniband provider to make sure that no user data is sent to older providers such as this one which do not expect it. It assumed when no user data is sent the udata->inlen is zero. The user-kernel API however always sends at least 8 octets (which may not be initialized in case of provider libraries that do not user user data). We remove the WARN_ON and rely on providers not to touch that field if their companion library is not expected to initialize it. Orabug: 24972331 Signed-off-by: Mukesh Kacker Reviewed-by: Santosh Shilimkar --- drivers/infiniband/hw/mlx4/main.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 4feb311d4eae..f1e4ca236d5f 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -771,12 +771,6 @@ static struct ib_shpd *mlx4_ib_alloc_shpd(struct ib_device *ibdev, { struct mlx4_ib_shpd *shpd; - /* - * Warn if we get udata which is not expected from the - * mellanox provider. - */ - WARN_ON(udata && udata->inlen > 0); - shpd = kzalloc(sizeof(*shpd), GFP_KERNEL); if (!shpd) return ERR_PTR(-ENOMEM); -- 2.50.1