diff options
author | Emil Goode <emilgoode@gmail.com> | 2013-06-06 13:55:28 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-06 19:54:09 (GMT) |
commit | cb3771b049b3b554455094a3b06d8ceb07086e06 (patch) | |
tree | f84159048eb643098e6aff063c306d635fc48ea1 /drivers/uio/uio_pruss.c | |
parent | fd5c25614012ccad75ef505982af4d6c08d0df83 (diff) | |
download | linux-fsl-qoriq-cb3771b049b3b554455094a3b06d8ceb07086e06.tar.xz |
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>
Diffstat (limited to 'drivers/uio/uio_pruss.c')
-rw-r--r-- | drivers/uio/uio_pruss.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c index 6e2ab00..21f7a72 100644 --- a/drivers/uio/uio_pruss.c +++ b/drivers/uio/uio_pruss.c @@ -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); |