]> git.baikalelectronics.ru Git - kernel.git/commit
serial: 8250_dw: Add valid clk pointer check
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Tue, 7 May 2013 11:27:16 +0000 (08:27 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 May 2013 18:54:55 +0000 (11:54 -0700)
commitf9955ab93336ffd7204564fe3906725789b472ec
tree8d6d30abe1d0d1576e593ab4aaee2b4e29ca2077
parent9dd09e6de2d6786a50b589a77aeec22d46f3a4ab
serial: 8250_dw: Add valid clk pointer check

Commit a9a5c072a "serial: 8250_dw: Enable runtime PM" introduced runtime
PM management, which enables/disables the clk without checking if the clk
is valid. However, this driver allows to be probed without a defined clk,
using clock-frequency, as a fallback.

Therefore, on platforms that are device tree probed using clock-frequency
instead of clk, we get an ugly NULL pointer dereference.

This patch fixes it by simply adding a check before accessing the clk api.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_dw.c