Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4849882pxj; Wed, 9 Jun 2021 03:29:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8y8q+/0iSQI0WlR+QyUO9fes89Q/US02GdTXLc5Vr3Djx7VZwC02We2NQH9IxbAQ8+OfR X-Received: by 2002:a17:906:26db:: with SMTP id u27mr28397889ejc.532.1623234599376; Wed, 09 Jun 2021 03:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623234599; cv=none; d=google.com; s=arc-20160816; b=ngvbFy1euEMpTh9+T0I7y74+TDacMrf9p5TyLwBzTVR0/CZXQWQ50SgoI4hcwZoR9V dQ9E3NKcSV+Lu1ONFvekHNHHgzrZABlJ8xJ3apWwJQkmYVp6vPhFacAG+e2jyjr1onkj iXDJtVEMTaVQEUw40yo5IdXZn60C4yCBJDJQFebGYXcf46aejNaNq6wQytm4TvXQOomv HZLS4cURaRV8+Yg3+AqnGif6ARat/+/Oxfv2DYyQpGoJCoMRDUSphhkFD+n+sJkiamV9 iJyX+hyADWjR/OaeY4v1Jyw79lnMC2Q1koLhZX68ckXnK40Cjd4+wdEQ+YvE2hAaYrEc BpBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B1DjloxncjYYmAmcr2RGirCXGPj0BJyFpqYsaXDP7fk=; b=KwvC/JgTzMCP0IefSdNLnbtsmrhN5WNRGH63myYG06qSkOPNXfIigoSw80LKZwM5+I +YeFlUdMVa7vvUDCt3GTdsgxF2vS0haFuspA16YGsp3xW+odrMTlDH5lxiGPJvklnVsm s06YKwCrnkMDFOi7gOeLEDZkUc5iN5H6T8BqFt5M9/wcGQ/GVS6paWeAmuH8tVagF2dE I3CitzqYDlqYEw+M+nNIzctikcNa8XwtAxCUdcUf0qkykk9/vMdKeja+1KN88tXC2N8c W9Z5s4Q2630quh0mh4yGlOYHl/BIwgwRtxetEfjnh2FLxlX/B3WVCI2wrjrs2Pj5FOSP ZWCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uiXpz3wA; 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=pass (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 o1si2018064edv.421.2021.06.09.03.29.35; Wed, 09 Jun 2021 03:29:59 -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=@linuxfoundation.org header.s=korg header.b=uiXpz3wA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236901AbhFHS7q (ORCPT + 99 others); Tue, 8 Jun 2021 14:59:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:50330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235139AbhFHSxB (ORCPT ); Tue, 8 Jun 2021 14:53:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CCC7761493; Tue, 8 Jun 2021 18:40:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177633; bh=JpwGp5xVlNaThGQCPQZqU7d9ztVREPqcBFJxpsspVJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uiXpz3wAmEKZcHZLBEkO2UJf4829ddJ6nwOdsLm4A7UtqXbzsPVCP5ERF00rD0Wop zayMICvh7g3yzdo//15Y1vIK5gN0VOg5i3N1oHVXdVtgPsIKaNFxEW7iHU9UVj9Po7 WkASMLF174g1HOISyzFm46IE6Z6bKkyA0oIjGct8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhen Lei , Max Gurtovoy , Alex Williamson , Sasha Levin Subject: [PATCH 5.10 010/137] vfio/pci: Fix error return code in vfio_ecap_init() Date: Tue, 8 Jun 2021 20:25:50 +0200 Message-Id: <20210608175942.731316533@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175942.377073879@linuxfoundation.org> References: <20210608175942.377073879@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhen Lei [ Upstream commit d1ce2c79156d3baf0830990ab06d296477b93c26 ] The error code returned from vfio_ext_cap_len() is stored in 'len', not in 'ret'. Fixes: 89e1f7d4c66d ("vfio: Add PCI device driver") Reported-by: Hulk Robot Signed-off-by: Zhen Lei Reviewed-by: Max Gurtovoy Message-Id: <20210515020458.6771-1-thunder.leizhen@huawei.com> Signed-off-by: Alex Williamson Signed-off-by: Sasha Levin --- drivers/vfio/pci/vfio_pci_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c index a402adee8a21..47f21a6ca7fe 100644 --- a/drivers/vfio/pci/vfio_pci_config.c +++ b/drivers/vfio/pci/vfio_pci_config.c @@ -1581,7 +1581,7 @@ static int vfio_ecap_init(struct vfio_pci_device *vdev) if (len == 0xFF) { len = vfio_ext_cap_len(vdev, ecap, epos); if (len < 0) - return ret; + return len; } } -- 2.30.2