powerpc/fsl-lbc: Fix for fsl_upm
authorAlexandre Rusev <arusev@dev.rtsoft.ru>
Thu, 27 Oct 2011 14:18:37 +0000 (18:18 +0400)
committerKumar Gala <galak@kernel.crashing.org>
Thu, 24 Nov 2011 08:00:42 +0000 (02:00 -0600)
If Freescale LBC driver fails to initialise itself from device tree, then
internal structure is freed only but not NULL-fied.  As result functions
fsl_lbc_find() after checking the structure is not NULL are trying to
access device registers.

Signed-off-by: Alexandre Rusev <arusev@dev.rtsoft.ru>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/sysdev/fsl_lbc.c

index c4d96fa32ba557a68512b133400fef585e799eb4..d5c3c90ee6981a14d40da0175f3d3ddc0c0f77f4 100644 (file)
@@ -328,6 +328,7 @@ static int __devinit fsl_lbc_ctrl_probe(struct platform_device *dev)
 err:
        iounmap(fsl_lbc_ctrl_dev->regs);
        kfree(fsl_lbc_ctrl_dev);
+       fsl_lbc_ctrl_dev = NULL;
        return ret;
 }