Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22542
b: refs/heads/master
c: 32f9579
h: refs/heads/master
v: v3
  • Loading branch information
Brian King authored and James Bottomley committed Feb 28, 2006
1 parent b1bd678 commit 7a5584b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ffedb4522571ac170f941678d138a31bc0884ab4
refs/heads/master: 32f95792500794a0a7cce266b7dafb2bee323bf8
15 changes: 13 additions & 2 deletions trunk/drivers/scsi/scsi_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ static struct scsi_target *scsi_alloc_target(struct device *parent,
+ shost->transportt->target_size;
struct scsi_target *starget;
struct scsi_target *found_target;
int error;

starget = kzalloc(size, GFP_KERNEL);
if (!starget) {
Expand Down Expand Up @@ -361,10 +362,20 @@ static struct scsi_target *scsi_alloc_target(struct device *parent,
spin_unlock_irqrestore(shost->host_lock, flags);
/* allocate and add */
transport_setup_device(dev);
device_add(dev);
error = device_add(dev);
if (error) {
dev_err(dev, "target device_add failed, error %d\n", error);
spin_lock_irqsave(shost->host_lock, flags);
list_del_init(&starget->siblings);
spin_unlock_irqrestore(shost->host_lock, flags);
transport_destroy_device(dev);
put_device(parent);
kfree(starget);
return NULL;
}
transport_add_device(dev);
if (shost->hostt->target_alloc) {
int error = shost->hostt->target_alloc(starget);
error = shost->hostt->target_alloc(starget);

if(error) {
dev_printk(KERN_ERR, dev, "target allocation failed, error %d\n", error);
Expand Down

0 comments on commit 7a5584b

Please sign in to comment.