diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2015-03-16 18:49:59 +0100 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-04-15 16:06:39 -0400 |
commit | cc47d369b51286129aad1735096b1884b8068ad1 (patch) | |
tree | 9a3cb89acaf5173765fcb4cef189b917c3f20194 /drivers/infiniband/hw/mlx4/qp.c | |
parent | d2928a8c0db061939ea34ff3f53f36dcccdf5aa2 (diff) |
infiniband/mlx4: check for mapping error
Since ib_dma_map_single can fail use ib_dma_mapping_error to check
for errors.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Acked-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/qp.c')
-rw-r--r-- | drivers/infiniband/hw/mlx4/qp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index ed2bd6701f9b..0766550d6ed9 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -566,6 +566,10 @@ static int alloc_proxy_bufs(struct ib_device *dev, struct mlx4_ib_qp *qp) ib_dma_map_single(dev, qp->sqp_proxy_rcv[i].addr, sizeof (struct mlx4_ib_proxy_sqp_hdr), DMA_FROM_DEVICE); + if (ib_dma_mapping_error(dev, qp->sqp_proxy_rcv[i].map)) { + kfree(qp->sqp_proxy_rcv[i].addr); + goto err; + } } return 0; |