bridge: mcast: Add a centralized error path
authorIdo Schimmel <idosch@nvidia.com>
Sat, 10 Dec 2022 14:56:23 +0000 (16:56 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 12 Dec 2022 23:33:37 +0000 (15:33 -0800)
commit160dd93114ddd31ed2b6290a7495d53717b79cf8
treee47921ef0de03d3c96915eb7783010fd54028518
parent1870a2d35abb6f4d8ff2213d50bbd082b1f8cde5
bridge: mcast: Add a centralized error path

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>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/bridge/br_mdb.c