[PATCH v3]: Fix e500 v2 core reboot bug

Zang Roy-r61911 tie-fei.zang at freescale.com
Wed Jun 13 16:31:12 EST 2007


On Wed, 2007-06-13 at 14:28, Segher Boessenkool wrote:
> > +     np = of_find_node_by_name(NULL, "global-utilities");
> > +     if ((np && of_get_property(np, "fsl,has-rstcr", NULL))) {
> 
> If this of_get_property fails...
> 
> > +             const u32 *prop = of_get_property(np, "reg", NULL);
> > +             if (prop) {
> > +                     /* map reset control register
> > +                      * 0xE00B0 is offset of reset control register
> > +                      */
> > +                     rstcr = ioremap(get_immrbase() + *prop + 0xB0,
> 0xff);
> > +                     if (!rstcr)
> > +                             printk (KERN_EMERG "Error: reset
> control \
> > +                                     register not mapped,
> spinning!\n");
> > +             }
> > +             of_node_put(np);
> 
> ...you still leak a reference.
You are right!!!
Roy




More information about the Linuxppc-dev mailing list