summaryrefslogtreecommitdiffstats
path: root/kernel/profile.c
diff options
context:
space:
mode:
authorJianxin Xiong <jianxin.xiong@intel.com>2016-10-17 04:19:41 -0700
committerDoug Ledford <dledford@redhat.com>2016-11-15 16:16:42 -0500
commit4dfe7cceb2bfd98783b4966d7c881a7552932d31 (patch)
tree18994f0e4d2c7c5da4a0346b92054aea96c33d21 /kernel/profile.c
parent83fb4af6800deb4f3d19b297df6148cda5c016de (diff)
downloadblackbird-op-linux-4dfe7cceb2bfd98783b4966d7c881a7552932d31.tar.gz
blackbird-op-linux-4dfe7cceb2bfd98783b4966d7c881a7552932d31.zip
IB/hfi1: Fix a potential memory leak in hfi1_create_ctxts()
In the function hfi1_create_ctxts the array "dd->rcd" is allocated and then populated with allocated resources in a loop. Previously, if error happened during the loop, only resource allocated in the current iteration would be freed. The array itself would then be freed, leaving the resources that were allocated in previous iterations and referenced by the array elements in limbo. This patch makes sure all allocated resources are freed before freeing the array "dd->rcd". Also the resource allocation now takes account of the numa node the device is attached to. Reviewed-by: Tadeusz Struk <tadeusz.struk@intel.com> Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'kernel/profile.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud