diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 061aada4748a7..9b4ae5c36da6b 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -2398,6 +2398,9 @@ static int macsec_upd_offload(struct sk_buff *skb, struct genl_info *info) return PTR_ERR(dev); macsec = macsec_priv(dev); + if (!tb_offload[MACSEC_OFFLOAD_ATTR_TYPE]) + return -EINVAL; + offload = nla_get_u8(tb_offload[MACSEC_OFFLOAD_ATTR_TYPE]); if (macsec->offload == offload) return 0;