uio: uio_pruss: Fix potential NULL pointer dereference

In function pruss_probe we free gdev and try to use
it on the next line. I have moved the dereference to
above the kfree of gdev.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Emil Goode 2013-06-06 15:55:28 +02:00 committed by Greg Kroah-Hartman
parent fd5c256140
commit cb3771b049
1 changed files with 1 additions and 1 deletions

View File

@ -136,9 +136,9 @@ static int pruss_probe(struct platform_device *dev)
gdev->pruss_clk = clk_get(&dev->dev, "pruss");
if (IS_ERR(gdev->pruss_clk)) {
dev_err(&dev->dev, "Failed to get clock\n");
ret = PTR_ERR(gdev->pruss_clk);
kfree(gdev->info);
kfree(gdev);
ret = PTR_ERR(gdev->pruss_clk);
return ret;
} else {
clk_enable(gdev->pruss_clk);