From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC8AB1AC8AE; Thu, 15 Aug 2024 14:12:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723731128; cv=none; b=jwwvIcjR/GNVtXx5jVX6c/jcqCkznucBz4jE7shzFCtnj5Rw1+rhcDmWnNimBipXyPqC53obJ62yvu7DEjiNAsI1AtUrsJLXd1JM4NU6WnB5p3zmvWtuJh7b0qIs7H8pkWD+nUGCkd8kZyiTHfvuyGkKk6Mgewv8eIgZ5r86iT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723731128; c=relaxed/simple; bh=Xmyzm1vw4ZTSJtD8lke4Vx1XnZJQzXRZtZhPrC/+N2k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bpR2M6bd4DXlVorxkmL639ek5f7WHfB4lICfpjTtodT6BcA76DvgXH5xUykDaSqJuRHYbEmQbfQaAIExyroVClKCw5r7DJUj0CF5b8ABc/50VXKl4NCBUsKeRyZFYQObA4rMzxApTV5PrXTEWR5TCZC20s5aUJ6kWakEKnXbmRw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=b7U36IPN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="b7U36IPN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F022C32786; Thu, 15 Aug 2024 14:12:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723731128; bh=Xmyzm1vw4ZTSJtD8lke4Vx1XnZJQzXRZtZhPrC/+N2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b7U36IPN6mUnsGtOH2gVbd9/WJWJ5Cs/CNZRHnuvJ5PeXSinu0p8kGy5QbICmMKtL AES+yzoZ4xH319yawIgsRnZarDvJm04XL04F1yrMAq6NpIuOQean7m1nRvFIR9Fqq4 dLd7UYY0Zvzgbr5WtTMLPxWQeFvmrBRdggtJ3kKo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , "Borislav Petkov (AMD)" , Andy Shevchenko , Sasha Levin Subject: [PATCH 5.4 008/259] x86/pci/intel_mid_pci: Fix PCIBIOS_* return code handling Date: Thu, 15 Aug 2024 15:22:21 +0200 Message-ID: <20240815131903.112822229@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240815131902.779125794@linuxfoundation.org> References: <20240815131902.779125794@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ilpo Järvinen [ Upstream commit 724852059e97c48557151b3aa4af424614819752 ] intel_mid_pci_irq_enable() uses pci_read_config_byte() that returns PCIBIOS_* codes. The error handling, however, assumes the codes are normal errnos because it checks for < 0. intel_mid_pci_irq_enable() also returns the PCIBIOS_* code back to the caller but the function is used as the (*pcibios_enable_irq) function which should return normal errnos. Convert the error check to plain non-zero check which works for PCIBIOS_* return codes and convert the PCIBIOS_* return code using pcibios_err_to_errno() into normal errno before returning it. Fixes: 5b395e2be6c4 ("x86/platform/intel-mid: Make IRQ allocation a bit more flexible") Signed-off-by: Ilpo Järvinen Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20240527125538.13620-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Sasha Levin --- arch/x86/pci/intel_mid_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c index eea5a0f3b959b..63513968f5617 100644 --- a/arch/x86/pci/intel_mid_pci.c +++ b/arch/x86/pci/intel_mid_pci.c @@ -223,9 +223,9 @@ static int intel_mid_pci_irq_enable(struct pci_dev *dev) return 0; ret = pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &gsi); - if (ret < 0) { + if (ret) { dev_warn(&dev->dev, "Failed to read interrupt line: %d\n", ret); - return ret; + return pcibios_err_to_errno(ret); } switch (intel_mid_identify_cpu()) { -- 2.43.0