提交 bd28899d 编写于 作者: D Dan Carpenter 提交者: David S. Miller

Revert "macsec: missing dev_put() on error in macsec_newlink()"

This patch is just wrong, sorry.  I was trying to fix a static checker
warning and misread the code.  The reference taken in macsec_newlink()
is released in macsec_free_netdev() when the netdevice is destroyed.

This reverts commit 5dcd8400.
Reported-by: NLaura Abbott <labbott@redhat.com>
Fixes: 5dcd8400 ("macsec: missing dev_put() on error in macsec_newlink()")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NSabrina Dubroca <sd@queasysnail.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c246fd33
......@@ -3277,7 +3277,7 @@ static int macsec_newlink(struct net *net, struct net_device *dev,
err = netdev_upper_dev_link(real_dev, dev, extack);
if (err < 0)
goto put_dev;
goto unregister;
/* need to be already registered so that ->init has run and
* the MAC addr is set
......@@ -3316,8 +3316,7 @@ static int macsec_newlink(struct net *net, struct net_device *dev,
macsec_del_dev(macsec);
unlink:
netdev_upper_dev_unlink(real_dev, dev);
put_dev:
dev_put(real_dev);
unregister:
unregister_netdevice(dev);
return err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册