diff options
author | Zhang Shurong <zhang_shurong@foxmail.com> | 2023-07-22 23:29:51 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-04 16:21:04 +0200 |
commit | 2fd84b9b839c3541815733701a06d9df48297a91 (patch) | |
tree | ff6d00edf1d38a0f8ee7d9f75628fdbce31c0cbb /drivers/uio | |
parent | 05d56d8079d510a2994039470f65bea85f0075ee (diff) | |
download | linux-stable-2fd84b9b839c3541815733701a06d9df48297a91.tar.gz linux-stable-2fd84b9b839c3541815733701a06d9df48297a91.tar.bz2 linux-stable-2fd84b9b839c3541815733701a06d9df48297a91.zip |
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.
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Link: https://lore.kernel.org/r/tencent_8E383752B54E5BF860711E500AD8A8971208@qq.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/uio')
-rw-r--r-- | drivers/uio/uio_pruss.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; |