]> git.baikalelectronics.ru Git - kernel.git/commit
IB/ipoib: Fix memory leak in create child syscall
authorFeras Daoud <ferasda@mellanox.com>
Wed, 14 Jun 2017 06:59:09 +0000 (09:59 +0300)
committerDoug Ledford <dledford@redhat.com>
Wed, 14 Jun 2017 19:16:23 +0000 (15:16 -0400)
commit63f5a0e8fe8d05ad4a6e56c3e21d8132f12a60f0
tree43f543c372350ff2ccf13be1003355b523834d7f
parent66a695304e9eb7dba29c1cf7d54202fae56a9191
IB/ipoib: Fix memory leak in create child syscall

The flow of creating a new child goes through ipoib_vlan_add
which allocates a new interface and checks the rtnl_lock.

If the lock is taken, restart_syscall will be called to restart
the system call again. In this case we are not releasing the
already allocated interface, causing a leak.

Fixes: 030f85e6ddc3 ("IB/ipoib: Add rtnl_link_ops support")
Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/ipoib/ipoib_vlan.c