Commit d18529a4 authored by Liang He's avatar Liang He Committed by Neil Armstrong
Browse files

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: default avatarLiang He <windhl@126.com>
Acked-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Fixes: b3dde501 ("soc: amlogic: Add support for Secure power domains controller")
Reviewed-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20220616144915.3988071-1-windhl@126.com
parent a2106f38
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);