]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
macsec: Fix invalid error code set
authorYueHaibing <yuehaibing@huawei.com>
Fri, 18 Nov 2022 01:12:49 +0000 (09:12 +0800)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Dec 2022 13:00:27 +0000 (14:00 +0100)
[ Upstream commit 7cef6b73fba96abef731a53501924fc3c4a0f947 ]

'ret' is defined twice in macsec_changelink(), when it is set in macsec_is_offloaded
case, it will be invalid before return.

Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Saeed Mahameed <saeed@kernel.org>
Reviewed-by: Antoine Tenart <atenart@kernel.org>
Link: https://lore.kernel.org/r/20221118011249.48112-1-yuehaibing@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 7fdd9daa5b1257bbe0e549878423687df1abbeb9)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
drivers/net/macsec.c

index f1961d7f9db2a043aa4987e01ef0ed6930014aa2..aa9d0dfeda5ab8b20097d900c4670e4a0a984a53 100644 (file)
@@ -3808,7 +3808,6 @@ static int macsec_changelink(struct net_device *dev, struct nlattr *tb[],
        if (macsec_is_offloaded(macsec)) {
                const struct macsec_ops *ops;
                struct macsec_context ctx;
-               int ret;
 
                ops = macsec_get_ops(netdev_priv(dev), &ctx);
                if (!ops) {