]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_router: Fix wrong kfree() in error path
authorIdo Schimmel <idosch@nvidia.com>
Tue, 17 Nov 2020 17:46:56 +0000 (19:46 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 18 Nov 2020 19:51:18 +0000 (11:51 -0800)
commitf49480feb2dad22405b03b1c3a4d3baa82eb2371
tree7c218e7a65b0a0b20127c06b827690ec571107da
parent2a95505554842fe6a40596b06434150b6dead5ad
mlxsw: spectrum_router: Fix wrong kfree() in error path

The function allocates 'nhgi', not 'nh_grp', so it needs to free the
former in its error path.

Fixes: 6e4d94ff4dc7 ("mlxsw: spectrum_router: Split nexthop group configuration to a different struct")
Addresses-Coverity: ("Memory - corruptions  (USE_AFTER_FREE)")
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c