]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 26 Feb 2017 05:34:32 +0000 (21:34 -0800)
commitcfd42a7c5a289626242bc19258311222a2c853a1
treefc52e5b86d6de2d6ff6c268a6965a7082ece62fc
parent2aba208122dacc1392892b2dedc0490223a5a4d4
macsec: fix negative refcnt on parent link

Orabug: 25243093

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: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0759e552bce7257db542e203a01a9ef8843c751e)
Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
drivers/net/macsec.c