OSDN Git Service

IB/core: Fix potential memory leak while creating MAD agents
authorDaniel Jurgens <danielj@mellanox.com>
Sat, 2 Feb 2019 09:09:43 +0000 (11:09 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 8 Feb 2019 23:24:44 +0000 (16:24 -0700)
commit6e88e672b69f0e627acdae74a527b730ea224b6b
tree54c540624cbe3e492b00cc414c4af1c90db3b86b
parentd60667fc398ed34b3c7456b020481c55c760e503
IB/core: Fix potential memory leak while creating MAD agents

If the MAD agents isn't allowed to manage the subnet, or fails to register
for the LSM notifier, the security context is leaked. Free the context in
these cases.

Fixes: 47a2b338fe63 ("IB/core: Enforce security on management datagrams")
Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Reported-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/security.c