]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: tag_8021q: avoid leaking ctx on dsa_tag_8021q_register() error path
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 9 Dec 2022 23:52:42 +0000 (01:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:29 +0000 (13:32 +0100)
commit8918d5d50cb0fe99f566c66e86ee60c631c8f615
treeb446c3cd94b5758962bff3c6bb07c36e74e4ba00
parent42694a6c36c0c5cec1fff88e07f27b2dcf59f79f
net: dsa: tag_8021q: avoid leaking ctx on dsa_tag_8021q_register() error path

[ Upstream commit edc331e08e301464fa2046b53db5aab9d82d7cc6 ]

If dsa_tag_8021q_setup() fails, for example due to the inability of the
device to install a VLAN, the tag_8021q context of the switch will leak.
Make sure it is freed on the error path.

Fixes: ee3f0b58ad79 ("net: dsa: tag_8021q: absorb dsa_8021q_setup into dsa_tag_8021q_{,un}register")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20221209235242.480344-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/dsa/tag_8021q.c