IB/qib: Fix an error code in qib_sdma_verbs_send()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 17 Dec 2018 07:05:36 +0000 (10:05 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:37:34 +0000 (15:37 +0100)
[ Upstream commit 5050ae5fa3d54c8e83e1e447cc7e3591110a7f57 ]

We accidentally return success on this error path.

Fixes: f931551bafe1 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/qib/qib_sdma.c

index 891873b38a1e610933d78ec7bcf02e80f82b0e6c..5f3f197678b78deb858e12bb812fe2c039c13ec7 100644 (file)
@@ -600,8 +600,10 @@ retry:
                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 */