diff options
author | Jakub Pawlak <jakub.pawlak@intel.com> | 2016-09-25 17:42:23 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-10-02 15:42:17 +0300 |
commit | 3a6982dfd3a7931d679a1aac651fda83ecbad0a0 (patch) | |
tree | 7efda22ab8e5ead4f40cefee67f2b0d58dfb92a0 /drivers/infiniband/hw/hfi1/init.c | |
parent | 242833fbe4e82b095140c00ff59519991a6c99fd (diff) | |
download | linux-3a6982dfd3a7931d679a1aac651fda83ecbad0a0.tar.xz |
IB/hfi1: Fix resource release in context allocation
Correct resource free in allocate_ctxt() function.
When context creation fails allocated resources are properly
released and pointer in receive context data table is set back
to NULL.
Reviewed-by: Dean Luick <dean.luick@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jakub Pawlak <jakub.pawlak@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/init.c')
-rw-r--r-- | drivers/infiniband/hw/hfi1/init.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index ab2f2217d7b9..60db61536fed 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c @@ -336,6 +336,7 @@ struct hfi1_ctxtdata *hfi1_create_ctxtdata(struct hfi1_pportdata *ppd, u32 ctxt, } return rcd; bail: + dd->rcd[ctxt] = NULL; kfree(rcd->egrbufs.rcvtids); kfree(rcd->egrbufs.buffers); kfree(rcd); |