]> www.infradead.org Git - users/dwmw2/linux.git/commit
infiniband: hfi1: fix a memory leak bug
authorWenwen Wang <wenwen@cs.uga.edu>
Sun, 18 Aug 2019 19:29:31 +0000 (14:29 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Sep 2019 09:35:22 +0000 (10:35 +0100)
commitbcb3211656fa24090a828cc2ee13cf8f3b95f08d
tree2a5e60a4742933d1299f3b94c0dea2efa6fd5643
parent1e93149659ccd7a427a73788b96b2e8d922688a0
infiniband: hfi1: fix a memory leak bug

[ Upstream commit b08afa064c320e5d85cdc27228426b696c4c8dae ]

In fault_opcodes_read(), 'data' is not deallocated if debugfs_file_get()
fails, leading to a memory leak. To fix this bug, introduce the 'free_data'
label to free 'data' before returning the error.

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Link: https://lore.kernel.org/r/1566156571-4335-1-git-send-email-wenwen@cs.uga.edu
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hfi1/fault.c