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)
committerDoug Ledford <dledford@redhat.com>
Wed, 5 Apr 2017 18:45:09 +0000 (14:45 -0400)
commit62eed66e98b4c2286fef2ce5911d8d75b7515f7b
treeffc487a61386670b9fea0621b4ec364b57ce445d
parent5d6f08afdd394c0b162cefe383093aace3e94e39
IB/hfi1: Protect the global dev_cntr_names and port_cntr_names

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.

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: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/verbs.c