Skip to content

Commit

Permalink
soc: amlogic: Fix refcount leak in meson-secure-pwrc.c
Browse files Browse the repository at this point in the history
[ Upstream commit d18529a ]

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: b3dde50 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
windhl authored and gregkh committed Aug 17, 2022
1 parent cb119a1 commit f370fbb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/soc/amlogic/meson-secure-pwrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,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);
Expand Down

0 comments on commit f370fbb

Please sign in to comment.