[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20120509064957.18494.11270.sendpatchset@w520>
Date: Wed, 09 May 2012 15:49:57 +0900
From: Magnus Damm <magnus.damm@...il.com>
To: linux-serial@...r.kernel.org
Cc: horms@...ge.net.au, arnd@...db.de, linux-sh@...r.kernel.org,
gregkh@...uxfoundation.org, swarren@...dotorg.org,
linux-kernel@...r.kernel.org, rjw@...k.pl,
paul.gortmaker@...driver.com, lethal@...ux-sh.org, olof@...om.net,
Magnus Damm <magnus.damm@...il.com>, dan.j.williams@...el.com,
alan@...ux.intel.com
Subject: [PATCH] serial8250-em: clk_get() IS_ERR() error handling fix
From: Magnus Damm <damm@...nsource.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@...nsource.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;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists