From patchwork Tue Jun 8 18:25:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 455823 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp4025968jae; Tue, 8 Jun 2021 12:05:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmxN3kkK0Rg/EJJgoFoEXqwQW1vklhYpvutwCcU8HbTOmKLpSIr/4WufSTiRRFHTsqq6HR X-Received: by 2002:a17:906:22c8:: with SMTP id q8mr24239785eja.12.1623179155775; Tue, 08 Jun 2021 12:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623179155; cv=none; d=google.com; s=arc-20160816; b=mX0HkLVz1/I5pYCilu/UnKe1/8fT0GqfhZyvixqkZKxczp6nBMqnzRa+ACSh5qZVvE WQqlmLOBSWi1r717EW1ug3CTTFm5SS6Qx1M2J0jti9JIbjnEe3GOedWCTyH4eD7G3ADP fdR1P/kH1V2WQU8AFR8vpTDIYhEC05hN9rGDr9FePtBk4v1eV2ySwz6idBWDHzVBOfrq uJff+HcMA0eN0isP/U1lc7FSxNggoOVmTC35T98b9yiGXxU0CydnuQpbN2PJIgLWLvrr CLVJAEfKoI/NGz43VIUn9ZgjXT47l4ZNR6Lm7nuihe4WVGG1reQ53bZm/BNE33mTM2pD 6Dew== 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=nsD03hQWfe/+8ux1pZWtoQEpARBf52J1yadj34dOQczlAJQ5oFCzhrBs+ZYRzTU5YC zaHCyI2cjPIzp1CmXtegBmz4bNiPrPxvVKRvizaq9QCqUyLeAM+pq0/QD40YEKJwd1y9 vFTzj7k/w6PVdXraexhve01EVa93jBYKpAWsB3dlzODvgRmoeT/bXa9XrJcnWipnGUVj a9ErdmWGbOh90QmtCeDWGULSzi+5t46bJ2/NDw4aY+ay6VkvnWTZXpwKaFtf7ZLZOxd2 /Cr1e0qv+JbgM9xWHP2GHba2D/y+x5WtaCS0m+0q5kXBSyNnyw98nSe72MUKxCYbUkGl +irQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E+Ztm3f8; 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 x5si390764edv.602.2021.06.08.12.05.55; Tue, 08 Jun 2021 12:05:55 -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=E+Ztm3f8; 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 S236192AbhFHTHH (ORCPT + 12 others); Tue, 8 Jun 2021 15:07:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:43872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237612AbhFHTFD (ORCPT ); Tue, 8 Jun 2021 15:05:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 50A67613B6; Tue, 8 Jun 2021 18:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177969; bh=JpwGp5xVlNaThGQCPQZqU7d9ztVREPqcBFJxpsspVJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E+Ztm3f8Nvd+ZIbpASwDxqlLOrDlKtgFVC/agg/32ph+PEm8C6agwLYqlZKU+eDre 4vWh5nXF7qR8kCcJ9fvvcLiwxmb27Jd3GkmKr4LzJ2EHfBLrbsWnF+F+e/1nBInVNx ebL46uHTBWOVJGF7En4aHrCgF7zdF60ZjhjV0Ho4= 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.12 011/161] vfio/pci: Fix error return code in vfio_ecap_init() Date: Tue, 8 Jun 2021 20:25:41 +0200 Message-Id: <20210608175945.850810674@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175945.476074951@linuxfoundation.org> References: <20210608175945.476074951@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 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; } }