* [PATCH] MIPS: ralink: add missing put_device in ill_acc_of_setup
@ 2019-12-25 13:15 yu kuai
2020-01-09 18:52 ` Paul Burton
0 siblings, 1 reply; 2+ messages in thread
From: yu kuai @ 2019-12-25 13:15 UTC (permalink / raw)
To: john, ralf, paulburton, jhogan
Cc: linux-mips, linux-kernel, yukuai3, zhengbin13, yi.zhang
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@huawei.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] MIPS: ralink: add missing put_device in ill_acc_of_setup
2019-12-25 13:15 [PATCH] MIPS: ralink: add missing put_device in ill_acc_of_setup yu kuai
@ 2020-01-09 18:52 ` Paul Burton
0 siblings, 0 replies; 2+ messages in thread
From: Paul Burton @ 2020-01-09 18:52 UTC (permalink / raw)
To: yu kuai
Cc: john, ralf, paulburton, jhogan, linux-mips, linux-kernel,
yukuai3, zhengbin13, yi.zhang, linux-mips
Hello,
yu kuai wrote:
> 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.
Applied to mips-next.
> commit defed0bbca2c
> https://git.kernel.org/mips/c/defed0bbca2c
>
> Signed-off-by: yu kuai <yukuai3@huawei.com>
> Signed-off-by: Paul Burton <paulburton@kernel.org>
Thanks,
Paul
[ This message was auto-generated; if you believe anything is incorrect
then please email paulburton@kernel.org to report it. ]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-09 18:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-25 13:15 [PATCH] MIPS: ralink: add missing put_device in ill_acc_of_setup yu kuai
2020-01-09 18:52 ` Paul Burton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).