diff options
author | Liang He <windhl@126.com> | 2022-06-16 17:49:15 +0300 |
---|---|---|
committer | Neil Armstrong <narmstrong@baylibre.com> | 2022-06-17 10:40:40 +0300 |
commit | d18529a4c12f66d83daac78045ea54063bd43257 (patch) | |
tree | 9724792b8061815887aa691d6ea71e06ccdf4c77 /drivers/soc | |
parent | a2106f38077e78afcb4bf98fdda3e162118cfb3d (diff) | |
download | linux-d18529a4c12f66d83daac78045ea54063bd43257.tar.xz |
soc: amlogic: Fix refcount leak in meson-secure-pwrc.c
In meson_secure_pwrc_probe(), there is a refcount leak in one fail
path.
Signed-off-by: Liang He <windhl@126.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Fixes: b3dde5013e13 ("soc: amlogic: Add support for Secure power domains controller")
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20220616144915.3988071-1-windhl@126.com
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/amlogic/meson-secure-pwrc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c index a10a417a87db..e93518763526 100644 --- a/drivers/soc/amlogic/meson-secure-pwrc.c +++ b/drivers/soc/amlogic/meson-secure-pwrc.c @@ -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); |