Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4829882pxj; Wed, 9 Jun 2021 02:57:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySXVD0t/jRm1QyXYIQ9olc4TLsaj3SGSB+LUBkSP+0PVoRfeZiTrvhfP73xIlww1rop19u X-Received: by 2002:a92:c041:: with SMTP id o1mr13045640ilf.117.1623232651019; Wed, 09 Jun 2021 02:57:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623232651; cv=none; d=google.com; s=arc-20160816; b=0o3wMjRdDWLjFuCcS4TvY2on9ogc5D5QHcUYZ0fsjrQKof6wkBvoF1aoMjOiv9GO41 hF6j6nw9k48S6qyD4MN7YYJ8pfYb0pJDRAJgbDgP2eIPv5maz+XYTufohwbj6mljn+MN QGHaH6Dx+HnPA30fcH7MYu88JtHLr5NhvN4VKuxzqgvkALY/FBJON+Vx17NgR77bxY/a kItnUHEB6Z4lujmkD4Ix4RVo5K088e3BmBK7YNh8u98yy8El78y1qYijBeZ19g6rBIBK AGoZfMaiS1OO8Ej12froJwTdqaLrFJRGPoq+qiBnWoOm4KyfbcP5ZQaZ0ulUsjLE0ZMV vK2A== 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=1Cxv2wDOkTuWMXIMs6oOyrjorxdBsUkqcMaWSEvBRaw=; b=ww8VG27oa51pc7PQ5U/wRK0p/gNNJxmA33cApEYm8vnDXl8vHhnHcgt8/xwp7tGwbN +zVt1h0YOqq9IFHtI4icyKV5+eoJdPZzWCtRWm9z07uzWgjctHbcGFPs8St5fxuWdE9I IVGWil5BD62HG+T1Ll0dCkhauL2M0ApXYp9RQ89z3qdcqDk6Yp38p+Vlcy358vXx27ds /EWW8y/YAYOXW/4+T5rtmVbS5q+zAS04XO6kIvKo2p7oGl2JqakA4l+oaks9x5/s3JeX INnPHrbaUaK4KobhLqG/a5/sOvJd18zXfFXSkGLCD6DkfjVHioCxjrMiqztNiuTyF0Pq CdUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WzfdggDG; 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 r24si2871793iog.39.2021.06.09.02.57.18; Wed, 09 Jun 2021 02:57:30 -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=WzfdggDG; 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 S236050AbhFHStr (ORCPT + 99 others); Tue, 8 Jun 2021 14:49:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:42126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235742AbhFHSoz (ORCPT ); Tue, 8 Jun 2021 14:44:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 961EF61359; Tue, 8 Jun 2021 18:36:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177402; bh=M+zKhaIuEUGO4xa6uK+sG9Nn7z4s6Psx9iEw9U7UOps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WzfdggDG4LIpk4J8Fk1U5XXBZnCQiKQYuLgVroQptzkHtqcUvEQZKzJQ/j3VZsyYa Qx8L96SdKYy/D4EtyPRaH3Tg6alntN4ZXWUbtaynUsPTlRFkEwo7OcWvTl1Qdmge4v 4kwmYrau2Bmsf8LoxMVSYLvJH6wF+6hFyUqcSWUY= 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.4 09/78] vfio/pci: Fix error return code in vfio_ecap_init() Date: Tue, 8 Jun 2021 20:26:38 +0200 Message-Id: <20210608175935.583353021@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175935.254388043@linuxfoundation.org> References: <20210608175935.254388043@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 bf32997c557f..50cd17fcf754 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; } } -- 2.30.2