transport_setup_device(&starget->dev); device_add(&starget->dev); transport_add_device(&starget->dev); 
transport_setup_device(dev); device_add(dev); transport_add_device(dev); if (shost->hostt->target_alloc) { int error = shost->hostt->target_alloc(starget);  if(error) { dev_printk(KERN_ERR, dev, "target allocation failed, error %d\n", error); /* don't want scsi_target_reap to do the final * put because it will be under the host lock */ get_device(dev); scsi_target_reap(starget); put_device(dev); return NULL; } }  
static struct scsi_target *scsi_alloc_target(struct device *parent,					     int channel, uint id){	struct Scsi_Host *shost = dev_to_shost(parent);	struct device *dev = NULL;	unsigned long flags;	const int size = sizeof(struct scsi_target)		+ shost->transportt->target_size;	struct scsi_target *starget = kmalloc(size, GFP_ATOMIC);	struct scsi_target *found_target;	if (!starget) {		printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__);		return NULL;	}	memset(starget, 0, size);	dev = &starget->dev;	device_initialize(dev);	starget->reap_ref = 1;	dev->parent = get_device(parent);	dev->release = scsi_target_dev_release;	sprintf(dev->bus_id, "target%d:%d:%d",		shost->host_no, channel, id);	starget->id = id;	starget->channel = channel;	INIT_LIST_HEAD(&starget->siblings);	INIT_LIST_HEAD(&starget->devices);	spin_lock_irqsave(shost->host_lock, flags);	found_target = __scsi_find_target(parent, channel, id);	if (found_target)		goto found;	list_add_tail(&starget->siblings, &shost->__targets);	spin_unlock_irqrestore(shost->host_lock, flags);	/* allocate and add */	transport_setup_device(&starget->dev);	device_add(&starget->dev);	transport_add_device(&starget->dev);	return starget; found:	found_target->reap_ref++;	spin_unlock_irqrestore(shost->host_lock, flags);	put_device(parent);	kfree(starget);	return found_target;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a283bd37d00e92e8874ca6325ae071691d4db388/scsi_scan.c/buggy/drivers/scsi/scsi_scan.c