Re: rtnl_lock() imbalance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Joakim Tjernlund/Transmode wrote on 2010/11/08 16:19:35:
>
> Trying to hunt down an rtnl_lock bug, br_add_bridge looks funny, it
> takes the rtnl_lock but doesn't release it in case of error. Bug?

ehh, missed that last goto out;
So no imbalance, sorry for the noise

>
> int br_add_bridge(struct net *net, const char *name)
> {
>  struct net_device *dev;
>  int ret;
>
>  dev = new_bridge_dev(net, name);
>  if (!dev)
>   return -ENOMEM;
>
>  rtnl_lock();
>  if (strchr(dev->name, '%')) {
>   ret = dev_alloc_name(dev, dev->name);
>   if (ret < 0)
>    goto out_free;
>  }
>
>  SET_NETDEV_DEVTYPE(dev, &br_type);
>
>  ret = register_netdevice(dev);
>  if (ret)
>   goto out_free;
>
>  ret = br_sysfs_addbr(dev);
>  if (ret)
>   unregister_netdevice(dev);
>  out:
>  rtnl_unlock();
>  return ret;
>
> out_free:
>  free_netdev(dev);
>  goto out;
> }

_______________________________________________
Bridge mailing list
Bridge@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/bridge


[Netdev]     [AoE Tools]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]     [Linux Resources]

Add to Google Powered by Linux