summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2012-05-09 08:49:57 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-10 00:11:30 +0200
commit94e792ab66d696aad2e52c91bae4cfbeefe4c9f6 (patch)
tree7305a6bc6e602c2edbb03dfd7c13168fbafa8145 /drivers/tty/serial
parentserial_core: Update buffer overrun statistics. (diff)
downloadlinux-94e792ab66d696aad2e52c91bae4cfbeefe4c9f6.tar.xz
linux-94e792ab66d696aad2e52c91bae4cfbeefe4c9f6.zip
serial8250-em: clk_get() IS_ERR() error handling fix
Update the 8250_em driver to correctly handle the case where no clock is associated with the device. The return value of clk_get() needs to be checked with IS_ERR() to avoid NULL pointer referencing. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/8250/8250_em.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/8250/8250_em.c b/drivers/tty/serial/8250/8250_em.c
index ff4254249bd8..be6c28937ecc 100644
--- a/drivers/tty/serial/8250/8250_em.c
+++ b/drivers/tty/serial/8250/8250_em.c
@@ -110,8 +110,9 @@ static int __devinit serial8250_em_probe(struct platform_device *pdev)
}
priv->sclk = clk_get(&pdev->dev, "sclk");
- if (!priv->sclk) {
+ if (IS_ERR(priv->sclk)) {
dev_err(&pdev->dev, "unable to get clock\n");
+ ret = PTR_ERR(priv->sclk);
goto err1;
}