]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.7.4/tty-serial-vt8500-fix-return-value-check-in-vt8500_serial_probe.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.7.4 / tty-serial-vt8500-fix-return-value-check-in-vt8500_serial_probe.patch
CommitLineData
8b92fd39
GKH
1From a6dd114e16cbc4410049a90a8a67b967333d108d Mon Sep 17 00:00:00 2001
2From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
3Date: Sun, 2 Dec 2012 05:10:44 -0500
4Subject: tty: serial: vt8500: fix return value check in vt8500_serial_probe()
5
6From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
7
8commit a6dd114e16cbc4410049a90a8a67b967333d108d upstream.
9
10In case of error, function of_clk_get() returns ERR_PTR()
11and never returns NULL. The NULL test in the return value
12check should be replaced with IS_ERR().
13
14Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
15Acked-by: Tony Prisk <linux@prisktech.co.nz>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17
18---
19 drivers/tty/serial/vt8500_serial.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22--- a/drivers/tty/serial/vt8500_serial.c
23+++ b/drivers/tty/serial/vt8500_serial.c
24@@ -604,7 +604,7 @@ static int __devinit vt8500_serial_probe
25 vt8500_port->uart.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
26
27 vt8500_port->clk = of_clk_get(pdev->dev.of_node, 0);
28- if (vt8500_port->clk) {
29+ if (!IS_ERR(vt8500_port->clk)) {
30 vt8500_port->uart.uartclk = clk_get_rate(vt8500_port->clk);
31 } else {
32 /* use the default of 24Mhz if not specified and warn */