]> git.hungrycats.org Git - linux/commit
IB/hfi1: Protect the global dev_cntr_names and port_cntr_names
authorTadeusz Struk <tadeusz.struk@intel.com>
Tue, 21 Mar 2017 00:25:35 +0000 (17:25 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 May 2017 13:46:30 +0000 (15:46 +0200)
commit8d6d97abb875d320debfabc55b32bca1166b3386
tree19b3fbd5f8516a62a1fcf299ab517e2dadc81a0d
parentb7705859189a225120e7b26cd475ccb770917893
IB/hfi1: Protect the global dev_cntr_names and port_cntr_names

commit 62eed66e98b4c2286fef2ce5911d8d75b7515f7b upstream.

Protect the global dev_cntr_names and port_cntr_names with the global
mutex as they are allocated and freed in a function called per device.
Otherwise there is a danger of double free and memory leaks.

Fixes: Commit b7481944b06e ("IB/hfi1: Show statistics counters under IB stats interface")
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Easwar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/hfi1/verbs.c