Skip to contentSkip to conversation

Fix for fsl_upm

PATCH Applied Rusev 2 participants 3 messages Oct 27, 2011 – Nov 24, 2011 PowerPC

lore
Share & tools
lore

Rusev

author
#0 lore raw

patch is vs. 2.6.39, yet it applied to 3.1

Fix of UPM driver for Freescale PowerPC processors

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.

arch/powerpc/sysdev/fsl_lbc.c +1 -0
@@ -322,6 +322,7 @@ static int __devinit fsl_lbc_ctrl_probe(
 err:
 	iounmap(fsl_lbc_ctrl_dev->regs);
 	kfree(fsl_lbc_ctrl_dev);
+	fsl_lbc_ctrl_dev = NULL;
 	return ret;
 }
 
#1 lore raw
Quoted 9 lines · Rusev

patch is vs. 2.6.39, yet it applied to 3.1
=20
=20
=20
Fix of UPM driver for Freescale PowerPC processors
=20
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

Quoted 4 lines

trying to access device registers.
=20

--- linux-2.6.39.old/arch/powerpc/sysdev/fsl_lbc.c 2011-10-27 =

03:17:28.000000000 +0400

Quoted 1 line

+++ linux-2.6.39/arch/powerpc/sysdev/fsl_lbc.c 2011-10-27 =

05:06:44.000000000 +0400

Quoted 8 lines
(quoted diff) +0 -0
@@ -322,6 +322,7 @@ static int __devinit fsl_lbc_ctrl_probe(

err:

	iounmap(fsl_lbc_ctrl_dev->regs);
	kfree(fsl_lbc_ctrl_dev);
(quoted diff) +1 -0
+	fsl_lbc_ctrl_dev =3D NULL;
	return ret;
}

=20

Can you send this as a proper patch.

- k

Applied
#2 lore raw
In reply to Rusev
Quoted 9 lines · Rusev

patch is vs. 2.6.39, yet it applied to 3.1
=20
=20
=20
Fix of UPM driver for Freescale PowerPC processors
=20
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

Quoted 3 lines

trying to access device registers.
=20

applied to next

- k=