]> git.hungrycats.org Git - linux/commitdiff
IB/mlx5: Return error for unsupported signature type
authorLeon Romanovsky <leonro@mellanox.com>
Wed, 18 Jan 2017 12:10:31 +0000 (14:10 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 5 Jun 2017 20:17:08 +0000 (21:17 +0100)
commit 12bbf1ea7e3b35892dbb8636b978160bc9576b61 upstream.

In case of unsupported singature, we returned positive
value, while the better approach is to return -EINVAL.

In addition, in this change, the error print is enriched
to provide an actual supplied signature type.

Fixes: e6631814fb3a ("IB/mlx5: Support IB_WR_REG_SIG_MR")
Cc: Sagi Grimberg <sagi@grimberg.me>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/infiniband/hw/mlx5/qp.c

index 3b21d3597be258d0c634240c79d43363ec6d357e..74cb286e6012aad645eb3d967688563faf85ed36 100644 (file)
@@ -2336,8 +2336,9 @@ static int set_psv_wr(struct ib_sig_domain *domain,
                break;
 
        default:
-               pr_err("Bad signature type given.\n");
-               return 1;
+               pr_err("Bad signature type (%d) is given.\n",
+                      domain->sig_type);
+               return -EINVAL;
        }
 
        return 0;