]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/thermal-int340x_thermal-fix-a-null-vs-is_err-check.patch
Linux 4.9.162
[thirdparty/kernel/stable-queue.git] / queue-4.14 / thermal-int340x_thermal-fix-a-null-vs-is_err-check.patch
1 From 0d6def51deecd6e7b6230bda259fef49a1b8bcc6 Mon Sep 17 00:00:00 2001
2 From: Dan Carpenter <dan.carpenter@oracle.com>
3 Date: Mon, 17 Dec 2018 10:02:42 +0300
4 Subject: thermal: int340x_thermal: Fix a NULL vs IS_ERR() check
5
6 [ Upstream commit 3fe931b31a4078395c1967f0495dcc9e5ec6b5e3 ]
7
8 The intel_soc_dts_iosf_init() function doesn't return NULL, it returns
9 error pointers.
10
11 Fixes: 4d0dd6c1576b ("Thermal/int340x/processor_thermal: Enable auxiliary DTS for Braswell")
12 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
13 Signed-off-by: Zhang Rui <rui.zhang@intel.com>
14 Signed-off-by: Sasha Levin <sashal@kernel.org>
15 ---
16 drivers/thermal/int340x_thermal/processor_thermal_device.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19 diff --git a/drivers/thermal/int340x_thermal/processor_thermal_device.c b/drivers/thermal/int340x_thermal/processor_thermal_device.c
20 index f02341f7134d4..c6ab7db8c8e23 100644
21 --- a/drivers/thermal/int340x_thermal/processor_thermal_device.c
22 +++ b/drivers/thermal/int340x_thermal/processor_thermal_device.c
23 @@ -416,7 +416,7 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev,
24 proc_priv->soc_dts = intel_soc_dts_iosf_init(
25 INTEL_SOC_DTS_INTERRUPT_MSI, 2, 0);
26
27 - if (proc_priv->soc_dts && pdev->irq) {
28 + if (!IS_ERR(proc_priv->soc_dts) && pdev->irq) {
29 ret = pci_enable_msi(pdev);
30 if (!ret) {
31 ret = request_threaded_irq(pdev->irq, NULL,
32 --
33 2.19.1
34