Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1339945pxa; Sun, 2 Aug 2020 04:19:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTOWwz91cFxMTf/ZpLBLk5H5BDBol8c705vdmVlGU6DJ5c29kA5QX1B5HnJPsakRrnUlKS X-Received: by 2002:a17:906:c406:: with SMTP id u6mr12601516ejz.47.1596367194757; Sun, 02 Aug 2020 04:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596367194; cv=none; d=google.com; s=arc-20160816; b=S6cABwgctBDbk1LryrcQvAyJOIOSl9zAnNnL8S2tpGdR83uAbBnSP5U2etEG27LHzP j3Os9sQCHiJkfVJGuPo7fi6KGJACZRDVYL171eit/iGZ1xH9vkmi7YhztIdar9ma5+NV 1jdD7olZjALNIcjzyJbJxcZuhVIRfoNGzr2oUCfVTIgomAZ34n4M8PfWjYeJtRfmBoGp Xutbpa7R3YkUTfdY+UEyyPZ/X5hgQC4wHUZEJWxsNu+4A3CtlgRuyVR3jnz1q0LKdbUJ jmv9q9mrbDMwytHI/xZFXKsDos3bCTEd9CZNCLQrRERT0IPJ7XFVNIRpsaHPgljADydb IgCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=M6qcuFTEnnu+/VidGcyGzUcBJfE7w/BOrsSSDBp5cBg=; b=tAX4OGFlA8vZsEjzQed7adH8dGHa3cA4oeVqlSQDNT8gW7CxjlPtcQXbSL5uIAE/Wx /pZcNwSW+vzTnvwg/xYxQWb08r9txAXMYh0QgMGeLNKpoFFdwayOFTQPX9DMF4KGrqDV B2aHrbd1ZZf0UloylXQ5gUeeSz5E4TzJ1egreeNSVXPhoz+/sajNN4h7bELnNKcwqp+q SCkPwvw5ZLHWkhWI6lZm2H2Hl0h9/JwJkf10x/TFY6qKuahXeQrOGUn3BpzTey/pXBsh hDI4lNp0xAWkaZxIGDm1uje5AxWViryz1BeRm6J4pkR12aQaV+BtvqvP4fIllJCiXXUu T9iQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d6si8417368eje.325.2020.08.02.04.19.33; Sun, 02 Aug 2020 04:19:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728437AbgHBLQS (ORCPT + 99 others); Sun, 2 Aug 2020 07:16:18 -0400 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:53166 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728224AbgHBLPm (ORCPT ); Sun, 2 Aug 2020 07:15:42 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0U4TpvXs_1596366939; Received: from localhost(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0U4TpvXs_1596366939) by smtp.aliyun-inc.com(127.0.0.1); Sun, 02 Aug 2020 19:15:39 +0800 From: Tianjia Zhang To: claudiu.manoil@nxp.com, davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, tianjia.zhang@alibaba.com Subject: [PATCH] net/enetc: Fix wrong return value in enetc_psfp_parse_clsflower() Date: Sun, 2 Aug 2020 19:15:38 +0800 Message-Id: <20200802111538.5338-1-tianjia.zhang@linux.alibaba.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Tianjia Zhang --- drivers/net/ethernet/freescale/enetc/enetc_qos.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc_qos.c b/drivers/net/ethernet/freescale/enetc/enetc_qos.c index fd3df19eaa32..4b3f1b60a24b 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_qos.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_qos.c @@ -1017,7 +1017,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv, !is_zero_ether_addr(match.mask->src)) { NL_SET_ERR_MSG_MOD(extack, "Cannot match on both source and destination MAC"); - err = EINVAL; + err = -EINVAL; goto free_filter; } @@ -1025,7 +1025,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv, if (!is_broadcast_ether_addr(match.mask->dst)) { NL_SET_ERR_MSG_MOD(extack, "Masked matching on destination MAC not supported"); - err = EINVAL; + err = -EINVAL; goto free_filter; } ether_addr_copy(filter->sid.dst_mac, match.key->dst); @@ -1036,7 +1036,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv, if (!is_broadcast_ether_addr(match.mask->src)) { NL_SET_ERR_MSG_MOD(extack, "Masked matching on source MAC not supported"); - err = EINVAL; + err = -EINVAL; goto free_filter; } ether_addr_copy(filter->sid.src_mac, match.key->src); @@ -1044,7 +1044,7 @@ static int enetc_psfp_parse_clsflower(struct enetc_ndev_priv *priv, } } else { NL_SET_ERR_MSG_MOD(extack, "Unsupported, must include ETH_ADDRS"); - err = EINVAL; + err = -EINVAL; goto free_filter; } -- 2.26.2