]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
IB/hfi1: Missing return value in error path for user sdma
authorMichael J. Ruhl <michael.j.ruhl@intel.com>
Mon, 10 Sep 2018 16:39:28 +0000 (09:39 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 26 Nov 2019 12:16:34 +0000 (13:16 +0100)
BugLink: https://bugs.launchpad.net/bugs/1853915
[ Upstream commit 2bf4b33f83dfe521c4c7c407b6b150aeec04d69c ]

If the set_txreq_header_agh() function returns an error, the exit path
is chosen.

In this path, the code fails to set the return value.  This will cause
the caller to not realize an error has occurred.

Set the return value correctly in the error path.

Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/infiniband/hw/hfi1/user_sdma.c

index cbff746d9e9deddc5f7140ebed61376afbfb0eaa..684a298e150370af34024410ffdee906073c2b3c 100644 (file)
@@ -856,8 +856,10 @@ static int user_sdma_send_pkts(struct user_sdma_request *req, unsigned maxpkts)
 
                                changes = set_txreq_header_ahg(req, tx,
                                                               datalen);
-                               if (changes < 0)
+                               if (changes < 0) {
+                                       ret = changes;
                                        goto free_tx;
+                               }
                        }
                } else {
                        ret = sdma_txinit(&tx->txreq, 0, sizeof(req->hdr) +