if (!(dev = kmalloc(sizeof(*dev), GFP_KERNEL))){ 
if (!(dev = kzalloc(sizeof(*dev), GFP_KERNEL))) { 
static int __devinit iic_probe(struct ocp_device *ocp){	struct ibm_iic_private* dev;	struct i2c_adapter* adap;	struct ocp_func_iic_data* iic_data = ocp->def->additions;	int ret;		if (!iic_data)		printk(KERN_WARNING"ibm-iic%d: missing additional data!\n",			ocp->def->index);	if (!(dev = kmalloc(sizeof(*dev), GFP_KERNEL))){		printk(KERN_CRIT "ibm-iic%d: failed to allocate device data\n",			ocp->def->index);		return -ENOMEM;	}	memset(dev, 0, sizeof(*dev));	dev->idx = ocp->def->index;	ocp_set_drvdata(ocp, dev);		if (!(dev->vaddr = ioremap(ocp->def->paddr, sizeof(struct iic_regs)))){		printk(KERN_CRIT "ibm-iic%d: failed to ioremap device registers\n",			dev->idx);		ret = -ENXIO;		goto fail2;	}		init_waitqueue_head(&dev->wq);	dev->irq = iic_force_poll ? -1 : ocp->def->irq;	if (dev->irq >= 0){		/* Disable interrupts until we finish initialization,		   assumes level-sensitive IRQ setup...		 */		iic_interrupt_mode(dev, 0);		if (request_irq(dev->irq, iic_handler, 0, "IBM IIC", dev)){			printk(KERN_ERR "ibm-iic%d: request_irq %d failed\n", 				dev->idx, dev->irq);			/* Fallback to the polling mode */				dev->irq = -1;		}	}		if (dev->irq < 0)		printk(KERN_WARNING "ibm-iic%d: using polling mode\n", 			dev->idx);			/* Board specific settings */	dev->fast_mode = iic_force_fast ? 1 : (iic_data ? iic_data->fast_mode : 0);		/* clckdiv is the same for *all* IIC interfaces, 	 * but I'd rather make a copy than introduce another global. --ebs	 */	dev->clckdiv = iic_clckdiv(ocp_sys_info.opb_bus_freq);	DBG("%d: clckdiv = %d\n", dev->idx, dev->clckdiv);		/* Initialize IIC interface */	iic_dev_init(dev);		/* Register it with i2c layer */	adap = &dev->adap;	strcpy(adap->name, "IBM IIC");	i2c_set_adapdata(adap, dev);	adap->id = I2C_HW_OCP;	adap->algo = &iic_algo;	adap->client_register = NULL;	adap->client_unregister = NULL;	adap->timeout = 1;	adap->retries = 1;	if ((ret = i2c_add_adapter(adap)) != 0){		printk(KERN_CRIT "ibm-iic%d: failed to register i2c adapter\n",			dev->idx);		goto fail;	}		printk(KERN_INFO "ibm-iic%d: using %s mode\n", dev->idx,		dev->fast_mode ? "fast (400 kHz)" : "standard (100 kHz)");	return 0;fail:		if (dev->irq >= 0){		iic_interrupt_mode(dev, 0);		free_irq(dev->irq, dev);	}		iounmap(dev->vaddr);fail2:		ocp_set_drvdata(ocp, NULL);	kfree(dev);		return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/5263ebb51eb098b01caf229498c954999117e4a7/i2c-ibm_iic.c/buggy/drivers/i2c/busses/i2c-ibm_iic.c