Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1338363pxa; Sun, 2 Aug 2020 04:16:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw08tu64tQ7bh568mpIYwX2m2mMKeIP4J+Bkq7J66X5rjEkoH5sVd46aLaUkvfYYqpMgBMW X-Received: by 2002:a17:906:8389:: with SMTP id p9mr11812812ejx.346.1596366991251; Sun, 02 Aug 2020 04:16:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596366991; cv=none; d=google.com; s=arc-20160816; b=o3WisHK2LyxeefnTrrLw8/iIxsdHPQ7bc+sMHolL810PTZnHCzUr1sboH7dwtGP0ma VTfvMgGh4vQGVHfQ99jUIBOzMGHgGRc3ZKrarabuLIfWs0TZpiGMHl1LJSakolgg+09w /SCG1IN6ESaaW1rBFUyQmvsbiOWY+qHn9IDKYYmupbJw3JOYI3LXU2si0Zh6cSIpFIbU JvJdsKG48O6vWTvFyqmnL+w0WLnzKJG/991bT9fWzc7EDAXzl9VjvjYcUEDaRqGndZ7W Q0xWtEQKiERKdUtwWEtdk8xJqJcCL5YZ64d1d3tPsuzSRtkYYqHSbL9N43793X2kXq24 /wuA== 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=6ysT6BEq4Ku8b2+WsUsi4El+qETMkhk1tvWYhhMZSf0=; b=J9NUhkF5T8mA7up496zpfIA/XrFWrWs/pLEWOIRggFvxvsPI/qLF5AO8TOsFJrf4PW Lhys7kbN7SxMuwbiRcTtcA/0Gto6snQFDU5GhmF9tgvIjjdRnyjn7YZTpUBTknEyT7WR TG08xReCAxMVdxP6brztlGcLeCewm/C5RQafYts21uPHzMdqH2ozTNC/WKiTgxvcm+v+ cu74MfZyzNfCfauOta7SK0Gt6DOdnpMEJyBgWFZ7te6Arrht2kfSWDoleSGve5IM+dat 8N6880lcJa+wYJRCnCng9U1mbhS+Ufk6AUph0oyiVVlsNSBg1atmE10Vsq5NrGqnxr+s 1s1Q== 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 y18si8653884edq.221.2020.08.02.04.16.09; Sun, 02 Aug 2020 04:16:31 -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 S1728332AbgHBLPv (ORCPT + 99 others); Sun, 2 Aug 2020 07:15:51 -0400 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:36431 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728291AbgHBLPt (ORCPT ); Sun, 2 Aug 2020 07:15:49 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01355;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0U4T1Vgj_1596366944; Received: from localhost(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0U4T1Vgj_1596366944) by smtp.aliyun-inc.com(127.0.0.1); Sun, 02 Aug 2020 19:15:44 +0800 From: Tianjia Zhang To: dchickles@marvell.com, sburla@marvell.com, fmanlunas@marvell.com, davem@davemloft.net, kuba@kernel.org, ricardo.farrington@cavium.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, tianjia.zhang@alibaba.com Subject: [PATCH] liquidio: Fix wrong return value in cn23xx_get_pf_num() Date: Sun, 2 Aug 2020 19:15:44 +0800 Message-Id: <20200802111544.5520-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 On an error exit path, a negative error code should be returned instead of a positive return value. Fixes: 0c45d7fe12c7e ("liquidio: fix use of pf in pass-through mode in a virtual machine") Cc: Rick Farrington Signed-off-by: Tianjia Zhang --- drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c index 43d11c38b38a..4cddd628d41b 100644 --- a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c +++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c @@ -1167,7 +1167,7 @@ static int cn23xx_get_pf_num(struct octeon_device *oct) oct->pf_num = ((fdl_bit >> CN23XX_PCIE_SRIOV_FDL_BIT_POS) & CN23XX_PCIE_SRIOV_FDL_MASK); } else { - ret = EINVAL; + ret = -EINVAL; /* Under some virtual environments, extended PCI regs are * inaccessible, in which case the above read will have failed. -- 2.26.2