summaryrefslogtreecommitdiff
path: root/drivers/uio/uio_pruss.c
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2016-11-26 00:55:30 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-29 20:43:12 +0100
commite663c5dbad2999aa824045c8e01fed459d1fc833 (patch)
treed11b8b5c1323bc799d437e0b31639ee07e3430b5 /drivers/uio/uio_pruss.c
parent999e4bf1d736611b84b6b695531ce29b9319241f (diff)
downloadlwn-e663c5dbad2999aa824045c8e01fed459d1fc833.tar.gz
lwn-e663c5dbad2999aa824045c8e01fed459d1fc833.zip
uio: pruss: add clk_disable()
pruss_probe() enables gdev->pruss_clk, but there is no clk_disable() in the driver. The patch adds clk_disable() to pruss_cleanup() and error handling for clk_enable(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/uio/uio_pruss.c')
-rw-r--r--drivers/uio/uio_pruss.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c
index ca9e2fafb0b6..31d5b1d3b5af 100644
--- a/drivers/uio/uio_pruss.c
+++ b/drivers/uio/uio_pruss.c
@@ -111,6 +111,7 @@ static void pruss_cleanup(struct device *dev, struct uio_pruss_dev *gdev)
gdev->sram_vaddr,
sram_pool_sz);
kfree(gdev->info);
+ clk_disable(gdev->pruss_clk);
clk_put(gdev->pruss_clk);
kfree(gdev);
}
@@ -143,7 +144,14 @@ static int pruss_probe(struct platform_device *pdev)
kfree(gdev);
return ret;
} else {
- clk_enable(gdev->pruss_clk);
+ ret = clk_enable(gdev->pruss_clk);
+ if (ret) {
+ dev_err(dev, "Failed to enable clock\n");
+ clk_put(gdev->pruss_clk);
+ kfree(gdev->info);
+ kfree(gdev);
+ return ret;
+ }
}
regs_prussio = platform_get_resource(pdev, IORESOURCE_MEM, 0);