macsec: add missing attribute validation for offload
[platform/kernel/linux-starfive.git] / drivers / net / macsec.c
index 85376d2..2fbac51 100644 (file)
@@ -3698,6 +3698,7 @@ static const struct nla_policy macsec_rtnl_policy[IFLA_MACSEC_MAX + 1] = {
        [IFLA_MACSEC_SCB] = { .type = NLA_U8 },
        [IFLA_MACSEC_REPLAY_PROTECT] = { .type = NLA_U8 },
        [IFLA_MACSEC_VALIDATION] = { .type = NLA_U8 },
+       [IFLA_MACSEC_OFFLOAD] = { .type = NLA_U8 },
 };
 
 static void macsec_free_netdev(struct net_device *dev)
@@ -3835,7 +3836,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) {