X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Fhosts.c;h=1592640a87b5404e14119b411596f80196468c81;hb=95e7a8efd79d4eb74646ed5cb998599f21627091;hp=880c78bff0e14a35e2ac6d6677b213946eca7ee8;hpb=75659ca0c10992dcb39258518368a0f6f56e935d;p=linux-2.6-omap-h63xx.git diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 880c78bff0e..1592640a87b 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -218,18 +218,24 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev) get_device(&shost->shost_gendev); - if (shost->transportt->host_size && - (shost->shost_data = kzalloc(shost->transportt->host_size, - GFP_KERNEL)) == NULL) - goto out_del_classdev; + if (shost->transportt->host_size) { + shost->shost_data = kzalloc(shost->transportt->host_size, + GFP_KERNEL); + if (shost->shost_data == NULL) { + error = -ENOMEM; + goto out_del_classdev; + } + } if (shost->transportt->create_work_queue) { snprintf(shost->work_q_name, KOBJ_NAME_LEN, "scsi_wq_%d", shost->host_no); shost->work_q = create_singlethread_workqueue( shost->work_q_name); - if (!shost->work_q) + if (!shost->work_q) { + error = -EINVAL; goto out_free_shost_data; + } } error = scsi_sysfs_add_host(shost); @@ -341,7 +347,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) shost->unchecked_isa_dma = sht->unchecked_isa_dma; shost->use_clustering = sht->use_clustering; shost->ordered_tag = sht->ordered_tag; - shost->active_mode = sht->supported_mode; if (sht->supported_mode == MODE_UNKNOWN) /* means we didn't set it ... default to INITIATOR */