Commit e663c5db authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Greg Kroah-Hartman

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: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 999e4bf1
...@@ -111,6 +111,7 @@ static void pruss_cleanup(struct device *dev, struct uio_pruss_dev *gdev) ...@@ -111,6 +111,7 @@ static void pruss_cleanup(struct device *dev, struct uio_pruss_dev *gdev)
gdev->sram_vaddr, gdev->sram_vaddr,
sram_pool_sz); sram_pool_sz);
kfree(gdev->info); kfree(gdev->info);
clk_disable(gdev->pruss_clk);
clk_put(gdev->pruss_clk); clk_put(gdev->pruss_clk);
kfree(gdev); kfree(gdev);
} }
...@@ -143,7 +144,14 @@ static int pruss_probe(struct platform_device *pdev) ...@@ -143,7 +144,14 @@ static int pruss_probe(struct platform_device *pdev)
kfree(gdev); kfree(gdev);
return ret; return ret;
} else { } 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); regs_prussio = platform_get_resource(pdev, IORESOURCE_MEM, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment