Pārlūkot izejas kodu

powerpc/fsl-lbc: Fix for fsl_upm

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>
Alexandre Rusev 13 gadi atpakaļ
vecāks
revīzija
7145cf1209
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. 1 0
      arch/powerpc/sysdev/fsl_lbc.c

+ 1 - 0
arch/powerpc/sysdev/fsl_lbc.c

@@ -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;
 }