Re: [PATCH] ASoC: mediatek: Fix error handling in mt8183_da7219_max98357_dev_probe

From: Tzung-Bi Shih
Date: Mon Mar 07 2022 - 21:03:22 EST


On Mon, Mar 07, 2022 at 01:19:21PM +0000, Miaoqian Lin wrote:
> The device_node pointer is returned by of_parse_phandle() with refcount
> incremented. We should use of_node_put() on it when done.
>
> This function only calls of_node_put() in the regular path.
> And it will cause refcount leak in error paths.
> Fix this by calling of_node_put() in error handling too.
>
> Fixes: ebbddc75bbe8 ("ASoC: Mediatek: MT8183: Add machine driver with DA7219")

I am not sure if the Fixes tag makes sense. ebbddc75bbe8 is the first commit
for the file; however, we have some more commits in between tip and
ebbddc75bbe8.

> Signed-off-by: Miaoqian Lin <linmq006@xxxxxxxxx>

With the minor comment,
Reviewed-by: Tzung-Bi Shih <tzungbi@xxxxxxxxxx>