Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alexey Khoroshilov and committed by
Greg Kroah-Hartman
e663c5db 999e4bf1

+9 -1
+9 -1
drivers/uio/uio_pruss.c
··· 111 111 gdev->sram_vaddr, 112 112 sram_pool_sz); 113 113 kfree(gdev->info); 114 + clk_disable(gdev->pruss_clk); 114 115 clk_put(gdev->pruss_clk); 115 116 kfree(gdev); 116 117 } ··· 144 143 kfree(gdev); 145 144 return ret; 146 145 } else { 147 - clk_enable(gdev->pruss_clk); 146 + ret = clk_enable(gdev->pruss_clk); 147 + if (ret) { 148 + dev_err(dev, "Failed to enable clock\n"); 149 + clk_put(gdev->pruss_clk); 150 + kfree(gdev->info); 151 + kfree(gdev); 152 + return ret; 153 + } 148 154 } 149 155 150 156 regs_prussio = platform_get_resource(pdev, IORESOURCE_MEM, 0);