IB/mlx5: fix debugfs cleanup
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Mon, 18 Sep 2017 11:28:48 +0000 (12:28 +0100)
committerDoug Ledford <dledford@redhat.com>
Fri, 22 Sep 2017 17:17:32 +0000 (13:17 -0400)
commitcbafad87e1507044c7d442087d41d5e3d432cc4e
tree2db96c58dc48ba61b77fff25fdbec5998e6e43a0
parent06564f60859bdf7e73d70ae35d7e285e96ae9c46
IB/mlx5: fix debugfs cleanup

If delay_drop_debugfs_init() fails in any of the operations to create
debugfs, it is calling delay_drop_debugfs_cleanup() as part of its
cleanup. But delay_drop_debugfs_cleanup() checks for 'dbg' and since
we have not yet pointed 'dbg' to the debugfs we need to cleanup, the
cleanup fails and we are left with stray debugfs elements and also a
memory leak.

Fixes: 4a5fd5d2965c ("IB/mlx5: Add necessary delay drop assignment")
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx5/main.c