From patchwork Tue Jun 8 18:26:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 455787 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp3994788jae; Tue, 8 Jun 2021 11:30:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEPJNSqQruaYroYSJUvw03H6c49CdMPZDNpGKj6486DTN0HM/czwFomK4XbFBNI3Zrhxxf X-Received: by 2002:a17:906:308d:: with SMTP id 13mr24261399ejv.554.1623177047918; Tue, 08 Jun 2021 11:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623177047; cv=none; d=google.com; s=arc-20160816; b=mps5HEdcQ2Nkv78a91xYdJnE8w0SkGsPfSYAHek4nTe7UrznzMqRCHn/TR1TaGicEt ghtrklRhaFYNKvI/UFQgvL0vFjweTwdULeaX2Gr1oDGUfqIv+/h5oHTW4ARYY5kfKSCV RedufK+qAe2iXwwcQGL3aqY0qKkDvFLjCLPdKad1vLykfNDmLhZ8lSdxF5kz5R24UBOk +UGBdTKwN/00UhnCxXnrlpkD+7rCsYJFG2JGCZXeRgRqCb9g3NKuZgipwcFiv1GYaejT wPw563kYhmya53+jV9O6Q11gPgS7RrtCQSDM59Il8SvGFAV+HiZlDmFhO4Sz49Kbwn2t K7dA== 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=eAgrB8bu/GEac8XjFkahsGhft5xOOP3CwCpXHhWf7BA=; b=iAT0F6pZ4jWUxnLXP+Kagmzo9Mj1lx8iG16FwL22/WLkTDA1TummzEeiU0ucxBCmz3 bqkEQm0+ekIJsaeY5XDWd+MWeF49R3lAPzw8f7UVtEMqJ++Fv8KF5wC88Nz6fKQZNmqU k+zbn40Uhq1n0Q75R09ic41RE96Xcb+KaLyd9hW/ib8KnoD3AfmSY9ATT81d55BtPIu4 D6EUGapgDKu1XTF/ljJqpWKxpj7wCVWfBA4QYw0VkVKOQPzreFOSaDjAjaeUrT0cW4r9 Q2BlRWoVwlniGsns/6sAJmhc0qUJtcNueSjCf/eH0kZKp12a9fYZEYhPnDsH2BCxhsEf 8OBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XIX4oTyD; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 e17si416787ejm.271.2021.06.08.11.30.47; Tue, 08 Jun 2021 11:30:47 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=XIX4oTyD; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S234213AbhFHScZ (ORCPT + 12 others); Tue, 8 Jun 2021 14:32:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:55748 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234221AbhFHSbs (ORCPT ); Tue, 8 Jun 2021 14:31:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6F600613CB; Tue, 8 Jun 2021 18:29:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623176977; bh=DtkpGIlSz7qqPuk4G/uy/HrLLxPvu5jhBLOU0tY58vo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XIX4oTyD675gvMAF+fkF5pAoLk+LCfkzHnLDAFzQr3Xqw8bZWA5Xsj2W32D/cwJ1w /vEqj2cAdEpQByCFL+AKAyOzgGu53ngvXD2/XzIlVcNqQXD4wmFch3iiwOYC0boqrh g8UIf8xEzweeAPGCGJ0I3LMKZVhJtsADrVmd5VZY= 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 4.9 04/29] vfio/pci: Fix error return code in vfio_ecap_init() Date: Tue, 8 Jun 2021 20:26:58 +0200 Message-Id: <20210608175927.963114322@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175927.821075974@linuxfoundation.org> References: <20210608175927.821075974@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.30.2 diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c index f3c2de04b20d..5b0f09b211be 100644 --- a/drivers/vfio/pci/vfio_pci_config.c +++ b/drivers/vfio/pci/vfio_pci_config.c @@ -1576,7 +1576,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; } }