From cb3771b049b3b554455094a3b06d8ceb07086e06 Mon Sep 17 00:00:00 2001 From: Emil Goode Date: Thu, 6 Jun 2013 15:55:28 +0200 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/uio/uio_pruss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/uio/uio_pruss.c') diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c index 6e2ab007fe9c..21f7a72301e4 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); -- cgit v1.2.3