Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6dd114e authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman
Browse files

tty: serial: vt8500: fix return value check in vt8500_serial_probe()



In case of error, function of_clk_get() returns ERR_PTR()
and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().

Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: default avatarTony Prisk <linux@prisktech.co.nz>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 87b8bed2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -604,7 +604,7 @@ static int vt8500_serial_probe(struct platform_device *pdev)
	vt8500_port->uart.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;

	vt8500_port->clk = of_clk_get(pdev->dev.of_node, 0);
	if (vt8500_port->clk) {
	if (!IS_ERR(vt8500_port->clk)) {
		vt8500_port->uart.uartclk = clk_get_rate(vt8500_port->clk);
	} else {
		/* use the default of 24Mhz if not specified and warn */