aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/bridge/br_if.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 497df086141a..a072ea5ca6f5 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -373,6 +373,10 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
373 if (IS_ERR(p)) 373 if (IS_ERR(p))
374 return PTR_ERR(p); 374 return PTR_ERR(p);
375 375
376 err = dev_set_promiscuity(dev, 1);
377 if (err)
378 goto put_back;
379
376 err = kobject_init_and_add(&p->kobj, &brport_ktype, &(dev->dev.kobj), 380 err = kobject_init_and_add(&p->kobj, &brport_ktype, &(dev->dev.kobj),
377 SYSFS_BRIDGE_PORT_ATTR); 381 SYSFS_BRIDGE_PORT_ATTR);
378 if (err) 382 if (err)
@@ -388,7 +392,6 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
388 392
389 rcu_assign_pointer(dev->br_port, p); 393 rcu_assign_pointer(dev->br_port, p);
390 dev_disable_lro(dev); 394 dev_disable_lro(dev);
391 dev_set_promiscuity(dev, 1);
392 395
393 list_add_rcu(&p->list, &br->port_list); 396 list_add_rcu(&p->list, &br->port_list);
394 397
@@ -412,12 +415,12 @@ err2:
412 br_fdb_delete_by_port(br, p, 1); 415 br_fdb_delete_by_port(br, p, 1);
413err1: 416err1:
414 kobject_del(&p->kobj); 417 kobject_del(&p->kobj);
415 goto put_back;
416err0: 418err0:
417 kobject_put(&p->kobj); 419 kobject_put(&p->kobj);
418 420 dev_set_promiscuity(dev, -1);
419put_back: 421put_back:
420 dev_put(dev); 422 dev_put(dev);
423 kfree(p);
421 return err; 424 return err;
422} 425}
423 426