android_kernel_motorola_sm6225/drivers/infiniband
Jack Morgenstein 6ddcb30256 IB/mlx4: Fix memory leak in add_gid error flow
commit eaad647e5cc27f7b46a27f3b85b14c4c8a64bffa upstream.

In procedure mlx4_ib_add_gid(), if the driver is unable to update the FW
gid table, there is a memory leak in the driver's copy of the gid table:
the gid entry's context buffer is not freed.

If such an error occurs, free the entry's context buffer, and mark the
entry as available (by setting its context pointer to NULL).

Fixes: e26be1bfef ("IB/mlx4: Implement ib_device callbacks")
Link: https://lore.kernel.org/r/20200115085050.73746-1-leon@kernel.org
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14 16:33:22 -05:00
..
core IB/core: Fix ODP get user pages flow 2020-02-11 04:34:13 -08:00
hw IB/mlx4: Fix memory leak in add_gid error flow 2020-02-14 16:33:22 -05:00
sw RDMA/rxe: Consider skb reserve space based on netdev of GID 2020-01-27 14:50:44 +01:00
ulp scsi: RDMA/isert: Fix a recently introduced regression related to logout 2020-01-29 16:43:21 +01:00
Kconfig IB/ucm: fix UCM link error 2018-08-21 16:56:32 -06:00
Makefile