]> git.baikalelectronics.ru Git - kernel.git/commit
macsec: fix negative refcnt on parent link
authorSabrina Dubroca <sd@queasysnail.net>
Fri, 29 Jul 2016 13:37:55 +0000 (15:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 31 Jul 2016 04:11:08 +0000 (21:11 -0700)
commit1972338232c99b8d46a1a76a7afcba65e4183db2
tree93c36c2d45305788c3c869bd9d636dbaaa3a70f7
parentd4179f45f5423e31ef427fee90e398ebcba6f8cc
macsec: fix negative refcnt on parent link

When creation of a macsec device fails because an identical device
already exists on this link, the current code decrements the refcnt on
the parent link (in ->destructor for the macsec device), but it had not
been incremented yet.

Move the dev_hold(parent_link) call earlier during macsec device
creation.

Fixes: 4f0c7417cca8 ("macsec: introduce IEEE 802.1AE driver")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macsec.c