Commit ed713e2b authored by 蒋家盛's avatar 蒋家盛 Committed by Abel Vesa
Browse files

clk: imx: Add check for kcalloc



As the potential failure of the kcalloc(),
it should be better to check it in order to
avoid the dereference of the NULL pointer.

Fixes: 379c9a24 ("clk: imx: Fix reparenting of UARTs not associated with stdout")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: default avatarAbel Vesa <abel.vesa@nxp.com>
Link: https://lore.kernel.org/r/20220310080257.1988412-1-jiasheng@iscas.ac.cn


Signed-off-by: default avatarAbel Vesa <abel.vesa@nxp.com>
parent ce0fc2f0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -176,6 +176,8 @@ void imx_register_uart_clocks(unsigned int clk_count)
		int i;

		imx_uart_clocks = kcalloc(clk_count, sizeof(struct clk *), GFP_KERNEL);
		if (!imx_uart_clocks)
			return;

		if (!of_stdout)
			return;