aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/bridge/br_multicast.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 326e599f83fb..85a0398b221e 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -654,11 +654,13 @@ static struct net_bridge_mdb_entry *br_multicast_new_group(
654 struct net_bridge_mdb_htable *mdb; 654 struct net_bridge_mdb_htable *mdb;
655 struct net_bridge_mdb_entry *mp; 655 struct net_bridge_mdb_entry *mp;
656 int hash; 656 int hash;
657 int err;
657 658
658 mdb = rcu_dereference_protected(br->mdb, 1); 659 mdb = rcu_dereference_protected(br->mdb, 1);
659 if (!mdb) { 660 if (!mdb) {
660 if (br_mdb_rehash(&br->mdb, BR_HASH_SIZE, 0)) 661 err = br_mdb_rehash(&br->mdb, BR_HASH_SIZE, 0);
661 return NULL; 662 if (err)
663 return ERR_PTR(err);
662 goto rehash; 664 goto rehash;
663 } 665 }
664 666
@@ -680,7 +682,7 @@ rehash:
680 682
681 mp = kzalloc(sizeof(*mp), GFP_ATOMIC); 683 mp = kzalloc(sizeof(*mp), GFP_ATOMIC);
682 if (unlikely(!mp)) 684 if (unlikely(!mp))
683 goto out; 685 return ERR_PTR(-ENOMEM);
684 686
685 mp->br = br; 687 mp->br = br;
686 mp->addr = *group; 688 mp->addr = *group;
@@ -713,7 +715,7 @@ static int br_multicast_add_group(struct net_bridge *br,
713 715
714 mp = br_multicast_new_group(br, port, group); 716 mp = br_multicast_new_group(br, port, group);
715 err = PTR_ERR(mp); 717 err = PTR_ERR(mp);
716 if (unlikely(IS_ERR(mp) || !mp)) 718 if (IS_ERR(mp))
717 goto err; 719 goto err;
718 720
719 if (!port) { 721 if (!port) {