lkml.org 
[lkml]   [2023]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mfd: intel-lpss: Add check for platform_get_irq
Date
The platform_get_irq() might be failed and return a negative result.
So there should have an error handling code.

Fixes: 4b45efe85263 ("mfd: Add support for Intel Sunrisepoint LPSS devices")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
drivers/mfd/intel-lpss-acpi.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c
index 212818aef93e..42b14a80b989 100644
--- a/drivers/mfd/intel-lpss-acpi.c
+++ b/drivers/mfd/intel-lpss-acpi.c
@@ -186,7 +186,11 @@ static int intel_lpss_acpi_probe(struct platform_device *pdev)
if (!info->mem)
return -ENODEV;

- info->irq = platform_get_irq(pdev, 0);
+ ret = platform_get_irq(pdev, 0);
+ if (ret < 0)
+ return ret;
+
+ info->irq = ret;

ret = intel_lpss_probe(&pdev->dev, info);
if (ret)
--
2.25.1
\
 
 \ /
  Last update: 2023-10-31 07:38    [W:0.027 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site