RDMA/ipoib: Fix check for return code from ib_create_srq
authorKamal Heib <kamalheib1@gmail.com>
Mon, 30 Jul 2018 18:56:44 +0000 (21:56 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 31 Jul 2018 02:29:45 +0000 (20:29 -0600)
Make sure to check for "-EOPNOTSUPP" instead of "-ENOSYS" which is the
return code from ib_create_srq() in case that it not supported.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/ulp/ipoib/ipoib_cm.c

index 8b44f33..8ef50e4 100644 (file)
@@ -1560,7 +1560,7 @@ static void ipoib_cm_create_srq(struct net_device *dev, int max_sge)
 
        priv->cm.srq = ib_create_srq(priv->pd, &srq_init_attr);
        if (IS_ERR(priv->cm.srq)) {
-               if (PTR_ERR(priv->cm.srq) != -ENOSYS)
+               if (PTR_ERR(priv->cm.srq) != -EOPNOTSUPP)
                        pr_warn("%s: failed to allocate SRQ, error %ld\n",
                               priv->ca->name, PTR_ERR(priv->cm.srq));
                priv->cm.srq = NULL;