From: Mukesh Kacker Date: Thu, 27 Oct 2016 13:07:16 +0000 (-0700) Subject: mlx4_ib: remove WARN_ON() based on incorrect assumptions X-Git-Tag: v4.1.12-92~53^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=28c090204b4dd9ea769ce4715e6f85ceb0d972d1;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 4feb311d4eaef..f1e4ca236d5f8 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);