clk: mediatek: Fix memory leak on clock init fail
mtk_clk_register_composite() may leak memory due to some error handling path don't free all allocated memory. This patch free all pointers that may allocate memory before error return. And it's safe because kfree() can handle NULL pointers. Signed-off-by: NJames Liao <jamesjj.liao@mediatek.com> Reviewed-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
Showing
想要评论请 注册 或 登录