Skip to content

Commit

Permalink
RDMA/hns: Add illegal hop_num judgement
Browse files Browse the repository at this point in the history
When hop_num is more than three, it need to return -EINVAL.  This patch
fixes it.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Lijun Ou authored and Jason Gunthorpe committed Jul 26, 2018
1 parent dedf635 commit 26f63b9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/infiniband/hw/hns/hns_roce_hem.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ static int hns_roce_table_mhop_get(struct hns_roce_dev *hr_dev,
step_idx = 1;
} else if (hop_num == HNS_ROCE_HOP_NUM_0) {
step_idx = 0;
} else {
ret = -EINVAL;
goto err_dma_alloc_l1;
}

/* set HEM base address to hardware */
Expand Down

0 comments on commit 26f63b9

Please sign in to comment.