Skip to content

Commit

Permalink
uio: pruss: add clk_disable()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexey Khoroshilov authored and Greg Kroah-Hartman committed Nov 29, 2016
1 parent 999e4bf commit e663c5d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/uio/uio_pruss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e663c5d

Please sign in to comment.