Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: MIPS: lantiq: fix clock error check

The clock should be checked with the proper IS_ERR() api before using it.

Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

John Crispin and committed by
Greg Kroah-Hartman
8ad2ee95 7c658e6b

+2 -2
+2 -2
drivers/tty/serial/lantiq.c
··· 318 318 struct ltq_uart_port *ltq_port = to_ltq_uart_port(port); 319 319 int retval; 320 320 321 - if (ltq_port->clk) 321 + if (!IS_ERR(ltq_port->clk)) 322 322 clk_enable(ltq_port->clk); 323 323 port->uartclk = clk_get_rate(ltq_port->fpiclk); 324 324 ··· 386 386 port->membase + LTQ_ASC_RXFCON); 387 387 ltq_w32_mask(ASCTXFCON_TXFEN, ASCTXFCON_TXFFLU, 388 388 port->membase + LTQ_ASC_TXFCON); 389 - if (ltq_port->clk) 389 + if (!IS_ERR(ltq_port->clk)) 390 390 clk_disable(ltq_port->clk); 391 391 } 392 392