[PATCH v3]: Fix e500 v2 core reboot bug

Segher Boessenkool segher at kernel.crashing.org
Wed Jun 13 16:28:08 EST 2007


> +	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.


Segher




More information about the Linuxppc-dev mailing list