IB/qib: Fix an error code in qib_sdma_verbs_send()

We accidentally return success on this error path.

Fixes: f931551baf ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Dan Carpenter 2018-12-17 10:05:36 +03:00 committed by Jason Gunthorpe
parent be5914c124
commit 5050ae5fa3

View file

@ -575,8 +575,10 @@ int qib_sdma_verbs_send(struct qib_pportdata *ppd,
dw = (len + 3) >> 2;
addr = dma_map_single(&ppd->dd->pcidev->dev, sge->vaddr,
dw << 2, DMA_TO_DEVICE);
if (dma_mapping_error(&ppd->dd->pcidev->dev, addr))
if (dma_mapping_error(&ppd->dd->pcidev->dev, addr)) {
ret = -ENOMEM;
goto unmap;
}
sdmadesc[0] = 0;
make_sdma_desc(ppd, sdmadesc, (u64) addr, dw, dwoffset);
/* SDmaUseLargeBuf has to be set in every descriptor */