if (chip) kfree(chip); 
kfree(chip); 
snd_ad1889_create(snd_card_t *card,		  struct pci_dev *pci,		  struct snd_ad1889 **rchip){	int err;	struct snd_ad1889 *chip;	static snd_device_ops_t ops = {		.dev_free = snd_ad1889_dev_free,	};	*rchip = NULL;	if ((err = pci_enable_device(pci)) < 0)		return err;		/* check PCI availability (32bit DMA) */	if (pci_set_dma_mask(pci, 0xffffffff) < 0 ||	    pci_set_consistent_dma_mask(pci, 0xffffffff) < 0) {		printk(KERN_ERR PFX "error setting 32-bit DMA mask.\n");		pci_disable_device(pci);		return -ENXIO;	}	/* allocate chip specific data with zero-filled memory */	if ((chip = kzalloc(sizeof(*chip), GFP_KERNEL)) == NULL) {		pci_disable_device(pci);		return -ENOMEM;	}	chip->card = card;	card->private_data = chip;	chip->pci = pci;	chip->irq = -1;	/* (1) PCI resource allocation */	if ((err = pci_request_regions(pci, card->driver)) < 0)		goto free_and_ret;	chip->bar = pci_resource_start(pci, 0);	chip->iobase = ioremap_nocache(chip->bar, pci_resource_len(pci, 0));	if (chip->iobase == NULL) {		printk(KERN_ERR PFX "unable to reserve region.\n");		err = -EBUSY;		goto free_and_ret;	}		pci_set_master(pci);	spin_lock_init(&chip->lock);	/* only now can we call ad1889_free */	if (request_irq(pci->irq, snd_ad1889_interrupt,			SA_INTERRUPT|SA_SHIRQ, card->driver, (void*)chip)) {		printk(KERN_ERR PFX "cannot obtain IRQ %d\n", pci->irq);		snd_ad1889_free(chip);		return -EBUSY;	}	chip->irq = pci->irq;	synchronize_irq(chip->irq);	/* (2) initialization of the chip hardware */	if ((err = snd_ad1889_init(chip)) < 0) {		snd_ad1889_free(chip);		return err;	}	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {		snd_ad1889_free(chip);		return err;	}	snd_card_set_dev(card, &pci->dev);	*rchip = chip;	return 0;free_and_ret:	if (chip)		kfree(chip);	pci_disable_device(pci);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/fc58422ad95a0f4936ead538e0b946aee5a4f98c/ad1889.c/buggy/sound/pci/ad1889.c