[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tencent_8E383752B54E5BF860711E500AD8A8971208@qq.com>
Date: Sat, 22 Jul 2023 23:29:51 +0800
From: Zhang Shurong <zhang_shurong@...mail.com>
To: gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org,
Zhang Shurong <zhang_shurong@...mail.com>
Subject: [PATCH] uio: pruss: fix to check return value of platform_get_irq() in pruss_probe()
The platform_get_irq might be failed and return a negative result. So
there should have an error handling code.
Fixed this by adding an error handling code.
Fixes: f1a304e7941c ("UIO: add PRUSS UIO driver support")
Signed-off-by: Zhang Shurong <zhang_shurong@...mail.com>
---
drivers/uio/uio_pruss.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c
index 83966dbd3bbf..122c38e2fbbd 100644
--- a/drivers/uio/uio_pruss.c
+++ b/drivers/uio/uio_pruss.c
@@ -175,8 +175,12 @@ static int pruss_probe(struct platform_device *pdev)
goto err_free_ddr_vaddr;
}
+ ret = platform_get_irq(pdev, 0);
+ if (ret < 0)
+ goto err_free_ddr_vaddr;
+
+ gdev->hostirq_start = ret;
gdev->pintc_base = pdata->pintc_base;
- gdev->hostirq_start = platform_get_irq(pdev, 0);
for (cnt = 0, p = gdev->info; cnt < MAX_PRUSS_EVT; cnt++, p++) {
p->mem[0].addr = regs_prussio->start;
--
2.41.0
Powered by blists - more mailing lists