diff options
| author | Kalderon, Michal <Michal.Kalderon@cavium.com> | 2018-06-11 03:20:20 -0400 |
|---|---|---|
| committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-06-11 13:04:14 -0400 |
| commit | 425cf5c1350a98b81f3ddda160b99c3be613a213 (patch) | |
| tree | 8d85ae382262f908df66769511c4106268e80afd /drivers | |
| parent | e31abf76f4d4d3202ca16b9668b11178df23d473 (diff) | |
RDMA/qedr: Fix NULL pointer dereference when running over iWARP without RDMA-CM
Some RoCE specific code in qedr_modify_qp was run over an iWARP device
when running perftest benchmarks without the -R option.
The commit 3e44e0ee0893 ("IB/providers: Avoid null netdev check for RoCE")
exposed this. Dropping the check for NULL pointer on ndev in
qedr_modify_qp lead to a null pointer dereference when running over
iWARP. Before the code would identify ndev as being NULL and return an
error.
Fixes: 3e44e0ee0893 ("IB/providers: Avoid null netdev check for RoCE")
Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/infiniband/hw/qedr/verbs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c index 614a954d0757..f9b198455fc9 100644 --- a/drivers/infiniband/hw/qedr/verbs.c +++ b/drivers/infiniband/hw/qedr/verbs.c | |||
| @@ -1957,6 +1957,9 @@ int qedr_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, | |||
| 1957 | } | 1957 | } |
| 1958 | 1958 | ||
| 1959 | if (attr_mask & (IB_QP_AV | IB_QP_PATH_MTU)) { | 1959 | if (attr_mask & (IB_QP_AV | IB_QP_PATH_MTU)) { |
| 1960 | if (rdma_protocol_iwarp(&dev->ibdev, 1)) | ||
| 1961 | return -EINVAL; | ||
| 1962 | |||
| 1960 | if (attr_mask & IB_QP_PATH_MTU) { | 1963 | if (attr_mask & IB_QP_PATH_MTU) { |
| 1961 | if (attr->path_mtu < IB_MTU_256 || | 1964 | if (attr->path_mtu < IB_MTU_256 || |
| 1962 | attr->path_mtu > IB_MTU_4096) { | 1965 | attr->path_mtu > IB_MTU_4096) { |
