Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4324197pxj; Tue, 8 Jun 2021 11:30:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLroeYnpbEPrCqtF95co/zNMo4D1kajzQibRwhWFhSM+l00+EYlW/0DmfunQpRIxH+upuF X-Received: by 2002:a17:906:dfd1:: with SMTP id jt17mr24825777ejc.486.1623177052100; Tue, 08 Jun 2021 11:30:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623177052; cv=none; d=google.com; s=arc-20160816; b=HASruj+GKKmsGK0C2A3K7a7QE3x2ugha3OhH3xUtMCFOoGq96vyX4lrRIouCmO+gZh suRr13n4K7t3NkbG2bbHGgUJHgYFhw/2O4uaSt5zogSzki1QZQgkY05n9nGybqfNsjq8 WVTM+IrolwKxu1i1+TfVYk6Zx+WzcuewDi8Zm3k9QidzQKHYWJzYkKIxXMwyc/00eBs2 nZdS5C5cjd+HrEfJ1lbf5LS6lNxCIJHl+R2BaLkkLDu3w5zgvsCMHG3t7neqXzAKcmUZ qkAeNqr2HYOUPr4l/f4+/CtpHKjnrz6xMB57roBbJbp2+WmniXlLIYcxNrGppsyQg1G/ 670Q== 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=Eo5x9aHvGUcjKY+0L75qI3vcxRLg/b5ErQCsSYYxjZM=; b=t3VtwhMGo+CytoaiRyNw9E9Dm8sbm9QBNO/yEjepfR7MNVbhzMXufAb5qqhHgTbn56 Ih0kU7I0P5dS/Bb3azjxWGzrvjtRHTeV92ISZJPKI3K1W1M0tNiLnr34Hefq7blgmuvb wy9oTIHA+9rg8Gm1kcOkEN5YatXbn6TU+CEoNoDPEV6d82U7VL2lL0c9l5m3XIYEq3rM VT0UsTtE1QXQwoOFQCS6BzF9xcXbBgUToPl9AnFBw07bMPos+AtvBdTX3f7eTCfLLyCn riOtZH/G4mMxLBWYIu/YdnU0aqfAv8AKokNTEezTUk4Gg4Zl4gpgUHT/48ZDLT18lwsd i1QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kap+4WyI; 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 r9si303106ejr.730.2021.06.08.11.30.28; Tue, 08 Jun 2021 11:30:52 -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=kap+4WyI; 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 S233682AbhFHSaq (ORCPT + 99 others); Tue, 8 Jun 2021 14:30:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:55022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233355AbhFHSal (ORCPT ); Tue, 8 Jun 2021 14:30:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F336261352; Tue, 8 Jun 2021 18:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623176914; bh=Ue9lbIDJj0P2m0BfjmqXGYFaocepRpggYF4jKEqrpKY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kap+4WyI+Cco9tXD1Ni2MR9p3Pq1bV8jruJsEYeeO+w2MHXjShf27pyv4JeaJyigl 3KtW8LwvVy2ASyRHNo9DhMkI5Kx7QjXW8NvhnohvUKPI45s2oRUwWkLaBkwbySgeUw 66wNbOWRO1j0jCnVlnJWPsaLpSebIDLw+afgROdk= 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.4 02/23] vfio/pci: Fix error return code in vfio_ecap_init() Date: Tue, 8 Jun 2021 20:26:54 +0200 Message-Id: <20210608175926.609575454@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175926.524658689@linuxfoundation.org> References: <20210608175926.524658689@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 666b234acca0..9891001244ea 100644 --- a/drivers/vfio/pci/vfio_pci_config.c +++ b/drivers/vfio/pci/vfio_pci_config.c @@ -1488,7 +1488,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