diff options
author | Dean Luick <dean.luick@intel.com> | 2016-07-28 21:21:17 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-08-03 04:46:21 +0200 |
commit | 9da7e9a711e6fbecd111b9873682480c77c64192 (patch) | |
tree | 72902e44dfb706ea9e311b47323f1c7fa1ae01bc /drivers/infiniband/hw/hfi1 | |
parent | IB/hfi1: Release node on insert failure (diff) | |
download | linux-9da7e9a711e6fbecd111b9873682480c77c64192.tar.xz linux-9da7e9a711e6fbecd111b9873682480c77c64192.zip |
IB/hfi1: Fix error condition that needs to clean up
If input validation fails, properly free the request before returning.
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1')
-rw-r--r-- | drivers/infiniband/hw/hfi1/user_sdma.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hfi1/user_sdma.c b/drivers/infiniband/hw/hfi1/user_sdma.c index ff03e1dad5b9..5c1322428065 100644 --- a/drivers/infiniband/hw/hfi1/user_sdma.c +++ b/drivers/infiniband/hw/hfi1/user_sdma.c @@ -617,7 +617,8 @@ int hfi1_user_sdma_process_request(struct file *fp, struct iovec *iovec, if (!info.npkts || req->data_iovs > MAX_VECTORS_PER_REQ) { SDMA_DBG(req, "Too many vectors (%u/%u)", req->data_iovs, MAX_VECTORS_PER_REQ); - return -EINVAL; + ret = -EINVAL; + goto free_req; } /* Copy the header from the user buffer */ ret = copy_from_user(&req->hdr, iovec[idx].iov_base + sizeof(info), |