Commit cb3771b0 authored by Emil Goode's avatar Emil Goode Committed by Greg Kroah-Hartman

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: default avatarEmil Goode <emilgoode@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fd5c2561
......@@ -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);
......
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