forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/arch/mips/ralink/ill_acc.c
....@@ -1,7 +1,5 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
2
- * This program is free software; you can redistribute it and/or modify it
3
- * under the terms of the GNU General Public License version 2 as published
4
- * by the Free Software Foundation.
53 *
64 * Copyright (C) 2013 John Crispin <john@phrozen.org>
75 */
....@@ -62,18 +60,21 @@
6260
6361 pdev = of_find_device_by_node(np);
6462 if (!pdev) {
65
- pr_err("%s: failed to lookup pdev\n", np->name);
63
+ pr_err("%pOFn: failed to lookup pdev\n", np);
64
+ of_node_put(np);
6665 return -EINVAL;
6766 }
6867
6968 irq = irq_of_parse_and_map(np, 0);
7069 if (!irq) {
7170 dev_err(&pdev->dev, "failed to get irq\n");
71
+ put_device(&pdev->dev);
7272 return -EINVAL;
7373 }
7474
7575 if (request_irq(irq, ill_acc_irq_handler, 0, "ill_acc", &pdev->dev)) {
7676 dev_err(&pdev->dev, "failed to request irq\n");
77
+ put_device(&pdev->dev);
7778 return -EINVAL;
7879 }
7980