]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mlx4_ib: remove WARN_ON() based on incorrect assumptions
authorMukesh Kacker <mukesh.kacker@oracle.com>
Thu, 27 Oct 2016 13:07:16 +0000 (06:07 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 28 Oct 2016 21:32:31 +0000 (14:32 -0700)
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 <mukesh.kacker@oracle.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
drivers/infiniband/hw/mlx4/main.c

index 4feb311d4eaef57c2e678192c887fe5a67d27674..f1e4ca236d5f8f4488867d96408804748ae0f4d3 100644 (file)
@@ -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);