On 08/12/2022 17:28, Ido Schimmel wrote:
Subsequent patches will add memory allocations in br_mdb_config_init()
as the MDB configuration structure will include a linked list of source
entries. This memory will need to be freed regardless if br_mdb_add()
succeeded or failed.
As a preparation for this change, add a centralized error path where the
memory will be freed.
Note that br_mdb_del() already has one error path and therefore does not
require any changes.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
net/bridge/br_mdb.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>