Commit bace287c authored by Tianjia Zhang's avatar Tianjia Zhang Committed by David S. Miller
Browse files

net/enetc: Fix wrong return value in enetc_psfp_parse_clsflower()



In the case of invalid rule, a positive value EINVAL is returned here.
I think this is a typo error. It is necessary to return an error value.

Cc: Po Liu <Po.Liu@nxp.com>
Signed-off-by: default avatarTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0470a488
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -1130,7 +1130,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv,
		    !is_zero_ether_addr(match.mask->src)) {
		    !is_zero_ether_addr(match.mask->src)) {
			NL_SET_ERR_MSG_MOD(extack,
			NL_SET_ERR_MSG_MOD(extack,
					   "Cannot match on both source and destination MAC");
					   "Cannot match on both source and destination MAC");
			err = EINVAL;
			err = -EINVAL;
			goto free_filter;
			goto free_filter;
		}
		}


@@ -1138,7 +1138,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv,
			if (!is_broadcast_ether_addr(match.mask->dst)) {
			if (!is_broadcast_ether_addr(match.mask->dst)) {
				NL_SET_ERR_MSG_MOD(extack,
				NL_SET_ERR_MSG_MOD(extack,
						   "Masked matching on destination MAC not supported");
						   "Masked matching on destination MAC not supported");
				err = EINVAL;
				err = -EINVAL;
				goto free_filter;
				goto free_filter;
			}
			}
			ether_addr_copy(filter->sid.dst_mac, match.key->dst);
			ether_addr_copy(filter->sid.dst_mac, match.key->dst);
@@ -1149,7 +1149,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv,
			if (!is_broadcast_ether_addr(match.mask->src)) {
			if (!is_broadcast_ether_addr(match.mask->src)) {
				NL_SET_ERR_MSG_MOD(extack,
				NL_SET_ERR_MSG_MOD(extack,
						   "Masked matching on source MAC not supported");
						   "Masked matching on source MAC not supported");
				err = EINVAL;
				err = -EINVAL;
				goto free_filter;
				goto free_filter;
			}
			}
			ether_addr_copy(filter->sid.src_mac, match.key->src);
			ether_addr_copy(filter->sid.src_mac, match.key->src);
@@ -1157,7 +1157,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv,
		}
		}
	} else {
	} else {
		NL_SET_ERR_MSG_MOD(extack, "Unsupported, must include ETH_ADDRS");
		NL_SET_ERR_MSG_MOD(extack, "Unsupported, must include ETH_ADDRS");
		err = EINVAL;
		err = -EINVAL;
		goto free_filter;
		goto free_filter;
	}
	}