[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191225131520.2505-1-yukuai3@huawei.com>
Date: Wed, 25 Dec 2019 21:15:20 +0800
From: yu kuai <yukuai3@...wei.com>
To: <john@...ozen.org>, <ralf@...ux-mips.org>, <paulburton@...nel.org>,
<jhogan@...nel.org>
CC: <linux-mips@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<yukuai3@...wei.com>, <zhengbin13@...wei.com>,
<yi.zhang@...wei.com>
Subject: [PATCH] MIPS: ralink: add missing put_device in ill_acc_of_setup
If of_find_device_by_node return 0 and ill_acc_of_setup return error,
pdev don't have a corresponding object release.
Fix it by adding put_device.
Signed-off-by: yu kuai <yukuai3@...wei.com>
---
arch/mips/ralink/ill_acc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/mips/ralink/ill_acc.c b/arch/mips/ralink/ill_acc.c
index 0ddeb31afa93..bdf53807d7c2 100644
--- a/arch/mips/ralink/ill_acc.c
+++ b/arch/mips/ralink/ill_acc.c
@@ -67,11 +67,13 @@ static int __init ill_acc_of_setup(void)
irq = irq_of_parse_and_map(np, 0);
if (!irq) {
dev_err(&pdev->dev, "failed to get irq\n");
+ put_device(&pdev->dev);
return -EINVAL;
}
if (request_irq(irq, ill_acc_irq_handler, 0, "ill_acc", &pdev->dev)) {
dev_err(&pdev->dev, "failed to request irq\n");
+ put_device(&pdev->dev);
return -EINVAL;
}
--
2.17.2
Powered by blists - more mailing lists