for (i = 0; i < ENVCTRL_MAX_CPU * 2; i++) { if (i2c_childlist[i].tables) kfree(i2c_childlist[i].tables); } 
for (i = 0; i < ENVCTRL_MAX_CPU * 2; i++) kfree(i2c_childlist[i].tables);  
static int __init envctrl_init(void){	struct linux_ebus *ebus = NULL;	struct linux_ebus_device *edev = NULL;	struct linux_ebus_child *edev_child = NULL;	int err, i = 0;	for_each_ebus(ebus) {		for_each_ebusdev(edev, ebus) {			if (!strcmp(edev->prom_name, "bbc")) {				/* If we find a boot-bus controller node,				 * then this envctrl driver is not for us.				 */				return -ENODEV;			}		}	}	/* Traverse through ebus and ebus device list for i2c device and	 * adc and gpio nodes.	 */	for_each_ebus(ebus) {		for_each_ebusdev(edev, ebus) {			if (!strcmp(edev->prom_name, "i2c")) {				i2c = ioremap(edev->resource[0].start, 0x2);				for_each_edevchild(edev, edev_child) {					if (!strcmp("gpio", edev_child->prom_name)) {						i2c_childlist[i].i2ctype = I2C_GPIO;						envctrl_init_i2c_child(edev_child, &(i2c_childlist[i++]));					}					if (!strcmp("adc", edev_child->prom_name)) {						i2c_childlist[i].i2ctype = I2C_ADC;						envctrl_init_i2c_child(edev_child, &(i2c_childlist[i++]));					}				}				goto done;			}		}	}done:	if (!edev) {		printk("envctrl: I2C device not found.\n");		return -ENODEV;	}	/* Set device address. */	writeb(CONTROL_PIN, i2c + PCF8584_CSR);	writeb(PCF8584_ADDRESS, i2c + PCF8584_DATA);	/* Set system clock and SCL frequencies. */ 	writeb(CONTROL_PIN | CONTROL_ES1, i2c + PCF8584_CSR);	writeb(CLK_4_43 | BUS_CLK_90, i2c + PCF8584_DATA);	/* Enable serial interface. */	writeb(CONTROL_PIN | CONTROL_ES0 | CONTROL_ACK, i2c + PCF8584_CSR);	udelay(200);	/* Register the device as a minor miscellaneous device. */	err = misc_register(&envctrl_dev);	if (err) {		printk("envctrl: Unable to get misc minor %d\n",		       envctrl_dev.minor);		goto out_iounmap;	}	/* Note above traversal routine post-incremented 'i' to accommodate 	 * a next child device, so we decrement before reverse-traversal of	 * child devices.	 */	printk("envctrl: initialized ");	for (--i; i >= 0; --i) {		printk("[%s 0x%lx]%s", 			(I2C_ADC == i2c_childlist[i].i2ctype) ? ("adc") : 			((I2C_GPIO == i2c_childlist[i].i2ctype) ? ("gpio") : ("unknown")), 			i2c_childlist[i].addr, (0 == i) ? ("\n") : (" "));	}	kenvctrld_task = kthread_run(kenvctrld, NULL, "kenvctrld");	if (IS_ERR(kenvctrld_task)) {		err = PTR_ERR(kenvctrld_task);		goto out_deregister;	}	return 0;out_deregister:	misc_deregister(&envctrl_dev);out_iounmap:	iounmap(i2c);	for (i = 0; i < ENVCTRL_MAX_CPU * 2; i++) {		if (i2c_childlist[i].tables)			kfree(i2c_childlist[i].tables);	}	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/6044ec8882c726e325017bd948aa0cd94ad33abc/envctrl.c/buggy/drivers/sbus/char/envctrl.c