Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2658764pxa; Mon, 17 Aug 2020 15:45:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/Ivd7dTDCXKAWYAtQseBIGTdAnRzJw2epFHVlFAbk0dlLHDvzND07MejhC54CsdHI1IOh X-Received: by 2002:a17:906:413:: with SMTP id d19mr18200995eja.523.1597704355646; Mon, 17 Aug 2020 15:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704355; cv=none; d=google.com; s=arc-20160816; b=o+przIHSjru+jRrkKuLRsXLs9dkRD6uhYly84X0xcV2oL+nEb1IGPV4liBqVHsrf+9 bfW2n3C0H3CtEH7C1HIqeIoCf5O5y7ZS7pMNRHVZQGtwoC+/G2wGsNWcJNfySST+hy+L 2YoZNP5zSHbH3Mna8GQzDA1VB3+iU4YzW5CCRAOVh77sqgwUOij+8+PWR2NV7+ETR41D 5WUcnvaW8LEefR0F/GU+4Glz4czUnTiWNE0C6GRQer738aFroE83DWRFedvQMR5N31jE 9gRg2Zx24TGkB/3nZXV2S/uRFCbKrIju7uz3kaGeKJv3VKD15BGDAwfXhE0p+zr8mdcR ouDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Kmzbuc+x4hklMM93N6fef8+u3x+T2PVYaQZwDwkSTxc=; b=XwFTTUvdbkeYBqMsBXxq1QDX/hkZdp6U7AnrRPZmIAEnU491dKcSfPlJC2w5wotzS8 b21WIdiD8zH09JgTeQvBcV0N4T2QwnjEUNbUTtN5ulSSK/J5qgijqnykA1OkHEIEuj4q z2+8J0t3HB8CVA0o+U3vLMVmIDW8TxpJsupyY/gQ4H2Y8aGn9iFTQp9m+u7eadgkD2Hu KXY2/CB6s6R71SeBUs78nJsmVYRlWbXHQSnmdiaag+MUzgyABNHPC6VuISlqcf30PfMM JCMUPTLc7JZ/5W6Eht54yKeeObkrkfZiv1w84QDbNQjwnSGfubDwp8gfUTo84gCmf9VZ K/tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dIR698ie; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j1si44880ejt.542.2020.08.17.15.45.32; Mon, 17 Aug 2020 15:45:55 -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; dkim=pass header.i=@kernel.org header.s=default header.b=dIR698ie; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388925AbgHQTVO (ORCPT + 99 others); Mon, 17 Aug 2020 15:21:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:43864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730503AbgHQPgi (ORCPT ); Mon, 17 Aug 2020 11:36:38 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CAC39208E4; Mon, 17 Aug 2020 15:36:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678592; bh=Npu3UeR3EM6VyxZdke2f0joPg//KAUdcSv7WEvWzGj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dIR698ie1DTDjrCidA9YcpzFs/OmuvZJi4l8sQIAsUCAkkkYQmwUyTH96OPe3GiuQ tXdsgz3VXVdWhCsqESN1fhJqNsmWkZFxVPiU78bhcvhYvDmZqkq8wqdBmOnTVJ/qPf fRy5gSnQmTnh7k3p/AkfDAJxaKrz+rG88joYc2Xk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rick Farrington , Tianjia Zhang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.8 357/464] liquidio: Fix wrong return value in cn23xx_get_pf_num() Date: Mon, 17 Aug 2020 17:15:10 +0200 Message-Id: <20200817143850.865635363@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tianjia Zhang [ Upstream commit aa027850a292ea65524b8fab83eb91a124ad362c ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 43d11c38b38a9..4cddd628d41b2 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.25.1