diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-04-16 13:17:50 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-16 10:01:12 -0400 |
commit | bd28899dd34f9283c567f7eeb31bb546f10820b5 (patch) | |
tree | fcfed1bd77ffee1353967ac7aae1952ec327c1fc /drivers/net/macsec.c | |
parent | c246fd333f84e6a0a8572f991637aa102f5e1865 (diff) | |
download | linux-riscv-bd28899dd34f9283c567f7eeb31bb546f10820b5.tar.gz linux-riscv-bd28899dd34f9283c567f7eeb31bb546f10820b5.tar.bz2 linux-riscv-bd28899dd34f9283c567f7eeb31bb546f10820b5.zip |
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 5dcd8400884cc4a043a6d4617e042489e5d566a9.
Reported-by: Laura Abbott <labbott@redhat.com>
Fixes: 5dcd8400884c ("macsec: missing dev_put() on error in macsec_newlink()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macsec.c')
-rw-r--r-- | drivers/net/macsec.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 9cbb0c8a896a..7de88b33d5b9 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -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 @@ del_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; } |