Merge tag 'amlogic-drivers-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel...
authorArnd Bergmann <arnd@arndb.de>
Fri, 1 Jul 2022 20:22:56 +0000 (22:22 +0200)
committerArnd Bergmann <arnd@arndb.de>
Fri, 1 Jul 2022 20:22:57 +0000 (22:22 +0200)
Amlogic Drivers changes for v5.20:
- Fix refcount leak in meson-secure-pwrc.c
- Fix refcount leak in meson_mx_socinfo_init

* tag 'amlogic-drivers-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux:
  soc: amlogic: Fix refcount leak in meson-secure-pwrc.c
  meson-mx-socinfo: Fix refcount leak in meson_mx_socinfo_init

Link: https://lore.kernel.org/r/0c01e173-9abf-69ac-7882-e6ecc3935c33@baylibre.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/soc/amlogic/meson-mx-socinfo.c
drivers/soc/amlogic/meson-secure-pwrc.c

index 78f0f1aeca578a1a7716b4e79c41b2b36c9015d2..92125dd65f338fe0466628e0fcdf4fcf124b9528 100644 (file)
@@ -126,6 +126,7 @@ static int __init meson_mx_socinfo_init(void)
        np = of_find_matching_node(NULL, meson_mx_socinfo_analog_top_ids);
        if (np) {
                analog_top_regmap = syscon_node_to_regmap(np);
+               of_node_put(np);
                if (IS_ERR(analog_top_regmap))
                        return PTR_ERR(analog_top_regmap);
 
index a10a417a87db894d8342325ba16986c4e90e7527..e9351876352672f163809b139ccc608589112d66 100644 (file)
@@ -152,8 +152,10 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev)
        }
 
        pwrc = devm_kzalloc(&pdev->dev, sizeof(*pwrc), GFP_KERNEL);
-       if (!pwrc)
+       if (!pwrc) {
+               of_node_put(sm_np);
                return -ENOMEM;
+       }
 
        pwrc->fw = meson_sm_get(sm_np);
        of_node_put(sm_np);