linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial8250-em: clk_get() IS_ERR() error handling fix
@ 2012-05-09  6:49 Magnus Damm
  0 siblings, 0 replies; only message in thread
From: Magnus Damm @ 2012-05-09  6:49 UTC (permalink / raw)
  To: linux-serial
  Cc: horms, arnd, linux-sh, gregkh, swarren, linux-kernel, rjw,
	paul.gortmaker, lethal, olof, Magnus Damm, dan.j.williams, alan

From: Magnus Damm <damm@opensource.se>

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>
---

 Applies of top of "[PATCH] serial8250-em: Emma Mobile UART driver V2"
 included in linux-next 20120508.

 drivers/tty/serial/8250/8250_em.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- 0001/drivers/tty/serial/8250/8250_em.c
+++ work/drivers/tty/serial/8250/8250_em.c	2012-05-09 15:35:10.000000000 +0900
@@ -110,8 +110,9 @@ static int __devinit serial8250_em_probe
 	}
 
 	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;
 	}
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-09  6:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-09  6:49 [PATCH] serial8250-em: clk_get() IS_ERR() error handling fix Magnus Damm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).