Skip to content

Commit

Permalink
serial8250-em: clk_get() IS_ERR() error handling fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Magnus Damm authored and Greg Kroah-Hartman committed May 9, 2012
1 parent 6421808 commit 94e792a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/tty/serial/8250/8250_em.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 94e792a

Please sign in to comment.