if (res->name) { kfree(res->name); res->name = NULL; } 
kfree(res->name); res->name = NULL; 
release_OF_resource(struct device_node* node, int index){	struct pci_dev* pcidev;	u8 pci_bus, pci_devfn;	unsigned long iomask, start, end;	struct device_node* nd;	struct resource* parent;	struct resource *res = NULL;	if (index >= node->n_addrs)		return -EINVAL;	/* Sanity check on bus space */	iomask = bus_space_to_resource_flags(node->addrs[index].space);	if (iomask & IORESOURCE_MEM)		parent = &iomem_resource;	else if (iomask & IORESOURCE_IO)		parent = &ioport_resource;	else		return -EINVAL;	/* Find a PCI parent if any */	nd = node;	pcidev = NULL;	while(nd) {		if (!pci_device_from_OF_node(nd, &pci_bus, &pci_devfn))			pcidev = pci_find_slot(pci_bus, pci_devfn);		if (pcidev) break;		nd = nd->parent;	}	if (pcidev)		parent = find_parent_pci_resource(pcidev, &node->addrs[index]);	if (!parent) {		printk(KERN_WARNING "release_OF_resource(%s), parent not found\n",			node->name);		return -ENODEV;	}	/* Find us in the parent and its childs */	res = parent->child;	start = node->addrs[index].address;	end = start + node->addrs[index].size - 1;	while (res) {		if (res->start == start && res->end == end &&		    (res->flags & IORESOURCE_BUSY))		    	break;		if (res->start <= start && res->end >= end)			res = res->child;		else			res = res->sibling;	}	if (!res)		return -ENODEV;	if (res->name) {		kfree(res->name);		res->name = NULL;	}	release_resource(res);	kfree(res);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b2325fe1b7e5654fac9e9419423aa2c58a3dbd83/prom.c/clean/arch/ppc/syslib/prom.c