From: Wei Yongjun Date: Sun, 2 Dec 2012 10:10:44 +0000 (-0500) Subject: tty: serial: vt8500: fix return value check in vt8500_serial_probe() X-Git-Tag: v3.7.4~7 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8d90fcdfc2ca59a7cac5c1907007b7a701219018;p=karo-tx-linux.git tty: serial: vt8500: fix return value check in vt8500_serial_probe() commit a6dd114e16cbc4410049a90a8a67b967333d108d upstream. 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: Wei Yongjun Acked-by: Tony Prisk Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c index 205d4cf4a063..f528cc2709cf 100644 --- a/drivers/tty/serial/vt8500_serial.c +++ b/drivers/tty/serial/vt8500_serial.c @@ -604,7 +604,7 @@ static int __devinit 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 */