if (info->buffer != NULL) kfree(info->buffer); if (info->toc != NULL) kfree(info->toc); if (info->changer_info != NULL) kfree(info->changer_info); 
kfree(info->buffer); kfree(info->toc); kfree(info->changer_info); 
static int ide_cd_probe(struct device *dev){	ide_drive_t *drive = to_ide_device(dev);	struct cdrom_info *info;	struct gendisk *g;	struct request_sense sense;	if (!strstr("ide-cdrom", drive->driver_req))		goto failed;	if (!drive->present)		goto failed;	if (drive->media != ide_cdrom && drive->media != ide_optical)		goto failed;	/* skip drives that we were told to ignore */	if (ignore != NULL) {		if (strstr(ignore, drive->name)) {			printk(KERN_INFO "ide-cd: ignoring drive %s\n", drive->name);			goto failed;		}	}	if (drive->scsi) {		printk(KERN_INFO "ide-cd: passing drive %s to ide-scsi emulation.\n", drive->name);		goto failed;	}	info = kzalloc(sizeof(struct cdrom_info), GFP_KERNEL);	if (info == NULL) {		printk(KERN_ERR "%s: Can't allocate a cdrom structure\n", drive->name);		goto failed;	}	g = alloc_disk(1 << PARTN_BITS);	if (!g)		goto out_free_cd;	ide_init_disk(g, drive);	ide_register_subdriver(drive, &ide_cdrom_driver);	kref_init(&info->kref);	info->drive = drive;	info->driver = &ide_cdrom_driver;	info->disk = g;	g->private_data = &info->driver;	drive->driver_data = info;	g->minors = 1;	snprintf(g->devfs_name, sizeof(g->devfs_name),			"%s/cd", drive->devfs_name);	g->driverfs_dev = &drive->gendev;	g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE;	if (ide_cdrom_setup(drive)) {		struct cdrom_device_info *devinfo = &info->devinfo;		ide_unregister_subdriver(drive, &ide_cdrom_driver);		if (info->buffer != NULL)			kfree(info->buffer);		if (info->toc != NULL)			kfree(info->toc);		if (info->changer_info != NULL)			kfree(info->changer_info);		if (devinfo->handle == drive && unregister_cdrom(devinfo))			printk (KERN_ERR "%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name);		kfree(info);		drive->driver_data = NULL;		goto failed;	}	cdrom_read_toc(drive, &sense);	g->fops = &idecd_ops;	g->flags |= GENHD_FL_REMOVABLE;	add_disk(g);	return 0;out_free_cd:	kfree(info);failed:	return -ENODEV;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/6044ec8882c726e325017bd948aa0cd94ad33abc/ide-cd.c/clean/drivers/ide/ide-cd.c