IB/hfi1: Fix memory leak in exception path in get_irq_affinity()
authorSebastian Sanchez <sebastian.sanchez@intel.com>
Tue, 1 May 2018 12:36:13 +0000 (05:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jun 2018 19:02:54 +0000 (04:02 +0900)
commit3c54e919bd4f41417b601448b73fa2c0aafb47d0
treeaaa10b93577c78f82113bff3346c9323240954d5
parent77662d35b8c5e95ad498c253d434c37e137a2eda
IB/hfi1: Fix memory leak in exception path in get_irq_affinity()

[ Upstream commit 59482a14918b282ca2a98f38c69da5ebeb1107d2 ]

When IRQ affinity is set and the interrupt type is unknown, a cpu
mask allocated within the function is never freed. Fix this memory
leak by allocating memory within the scope where it is used.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/hfi1/affinity.c