Skip to content

Commit

Permalink
serial: pl011: protect attribute read from NULL platform data struct
Browse files Browse the repository at this point in the history
It's completely feasible that platform data will be empty i.e. when
booting with Device Tree with no device AUXDATA. So we must protect
it's use in these use-cases, or risk a kernel Oops.

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Lee Jones authored and Greg Kroah-Hartman committed May 20, 2013
1 parent 383d2fc commit f6b6f52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/tty/serial/amba-pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port *
dmaengine_slave_config(chan, &rx_conf);
uap->dmarx.chan = chan;

if (plat->dma_rx_poll_enable) {
if (plat && plat->dma_rx_poll_enable) {
/* Set poll rate if specified. */
if (plat->dma_rx_poll_rate) {
uap->dmarx.auto_poll_rate = false;
Expand Down

0 comments on commit f6b6f52

Please sign in to comment.