]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
IB/core: Reuse gid_table_release_one() in table allocation failure
authorParav Pandit <parav@mellanox.com>
Wed, 2 May 2018 10:12:56 +0000 (13:12 +0300)
committerDoug Ledford <dledford@redhat.com>
Wed, 9 May 2018 16:08:21 +0000 (12:08 -0400)
commitbe0e8f34b66c47fb9bf65858d0cd4b145d1e47b1
treeeef4dcfc1889bd58383f372ff5f44dcb598072b1
parent25a1cd3fe551bfeffc12d6ef1aafb2f2ef5e54f6
IB/core: Reuse gid_table_release_one() in table allocation failure

_gid_table_setup_one() only performs GID table cache memory allocation,
marks entries as invalid (free) and marks the reserved entries.
At this point GID table is empty and no entries are added.

On dual port device if _gid_table_setup_one() fails to allocate the gid
table for 2nd port, there is no need to perform cleanup_gid_table_port()
to delete GID entries, as GID table is empty.
Therefore make use of existing gid_table_release_one() routine which
frees the GID table memory and avoid code duplication.

Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/cache.c