8 Mar
2022
8 Mar
'22
3:03 a.m.
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@gmail.com
With the minor comment, Reviewed-by: Tzung-Bi Shih tzungbi@kernel.org