summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorJon Ringle <jringle@gridpoint.com>2014-07-25 13:53:36 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-27 11:50:38 -0700
commitdc824ebed081ed6227772b3cc5f9c7a6683fb489 (patch)
treeae20896a4bde8c38428dc593b684d6a6633dc7c2 /drivers/tty
parentc8ed99d4f6a8ac03f397877d25428698f461a2af (diff)
downloadlinux-dc824ebed081ed6227772b3cc5f9c7a6683fb489.tar.bz2
serial: sc16is7xx: Correct initialization of s->clk
The s->clk never gets setup in sc16is7xx_probe() and instead was using a local clk variable, but then testing the uninitialized s->clk during teardown Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jon Ringle <jringle@gridpoint.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/sc16is7xx.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 914825e03427..3284c31085a7 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1060,7 +1060,6 @@ static int sc16is7xx_probe(struct device *dev,
struct regmap *regmap, int irq, unsigned long flags)
{
unsigned long freq, *pfreq = dev_get_platdata(dev);
- struct clk *clk;
int i, ret;
struct sc16is7xx_port *s;
@@ -1076,14 +1075,14 @@ static int sc16is7xx_probe(struct device *dev,
return -ENOMEM;
}
- clk = devm_clk_get(dev, NULL);
- if (IS_ERR(clk)) {
+ s->clk = devm_clk_get(dev, NULL);
+ if (IS_ERR(s->clk)) {
if (pfreq)
freq = *pfreq;
else
- return PTR_ERR(clk);
+ return PTR_ERR(s->clk);
} else {
- freq = clk_get_rate(clk);
+ freq = clk_get_rate(s->clk);
}
s->regmap = regmap;