提交 7f25301d 编写于 作者: W Wei Yongjun 提交者: Greg Kroah-Hartman

serial: omap: fix potential NULL pointer dereference in serial_omap_runtime_suspend()

The dereference to 'up' should be moved below the NULL test.
Introduced by commit ddd85e22
(serial: omap: prevent runtime PM for "no_console_suspend")
Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: NTony Lindgren <tony@atomide.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 c36d6006
......@@ -1613,6 +1613,9 @@ static int serial_omap_runtime_suspend(struct device *dev)
struct uart_omap_port *up = dev_get_drvdata(dev);
struct omap_uart_port_info *pdata = dev->platform_data;
if (!up)
return -EINVAL;
/*
* When using 'no_console_suspend', the console UART must not be
* suspended. Since driver suspend is managed by runtime suspend,
......@@ -1623,9 +1626,6 @@ static int serial_omap_runtime_suspend(struct device *dev)
uart_console(&up->port))
return -EBUSY;
if (!up)
return -EINVAL;
if (!pdata)
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册