diff options
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r-- | drivers/scsi/libata-core.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index f53d7b8ac3..b1b1c6f014 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -370,6 +370,8 @@ static void ata_tf_read_pio(struct ata_port *ap, struct ata_taskfile *tf) | |||
370 | { | 370 | { |
371 | struct ata_ioports *ioaddr = &ap->ioaddr; | 371 | struct ata_ioports *ioaddr = &ap->ioaddr; |
372 | 372 | ||
373 | tf->command = ata_check_status(ap); | ||
374 | tf->feature = ata_chk_err(ap); | ||
373 | tf->nsect = inb(ioaddr->nsect_addr); | 375 | tf->nsect = inb(ioaddr->nsect_addr); |
374 | tf->lbal = inb(ioaddr->lbal_addr); | 376 | tf->lbal = inb(ioaddr->lbal_addr); |
375 | tf->lbam = inb(ioaddr->lbam_addr); | 377 | tf->lbam = inb(ioaddr->lbam_addr); |
@@ -402,6 +404,8 @@ static void ata_tf_read_mmio(struct ata_port *ap, struct ata_taskfile *tf) | |||
402 | { | 404 | { |
403 | struct ata_ioports *ioaddr = &ap->ioaddr; | 405 | struct ata_ioports *ioaddr = &ap->ioaddr; |
404 | 406 | ||
407 | tf->command = ata_check_status(ap); | ||
408 | tf->feature = ata_chk_err(ap); | ||
405 | tf->nsect = readb((void __iomem *)ioaddr->nsect_addr); | 409 | tf->nsect = readb((void __iomem *)ioaddr->nsect_addr); |
406 | tf->lbal = readb((void __iomem *)ioaddr->lbal_addr); | 410 | tf->lbal = readb((void __iomem *)ioaddr->lbal_addr); |
407 | tf->lbam = readb((void __iomem *)ioaddr->lbam_addr); | 411 | tf->lbam = readb((void __iomem *)ioaddr->lbam_addr); |
@@ -4254,11 +4258,10 @@ int ata_device_add(const struct ata_probe_ent *ent) | |||
4254 | 4258 | ||
4255 | DPRINTK("ENTER\n"); | 4259 | DPRINTK("ENTER\n"); |
4256 | /* alloc a container for our list of ATA ports (buses) */ | 4260 | /* alloc a container for our list of ATA ports (buses) */ |
4257 | host_set = kmalloc(sizeof(struct ata_host_set) + | 4261 | host_set = kzalloc(sizeof(struct ata_host_set) + |
4258 | (ent->n_ports * sizeof(void *)), GFP_KERNEL); | 4262 | (ent->n_ports * sizeof(void *)), GFP_KERNEL); |
4259 | if (!host_set) | 4263 | if (!host_set) |
4260 | return 0; | 4264 | return 0; |
4261 | memset(host_set, 0, sizeof(struct ata_host_set) + (ent->n_ports * sizeof(void *))); | ||
4262 | spin_lock_init(&host_set->lock); | 4265 | spin_lock_init(&host_set->lock); |
4263 | 4266 | ||
4264 | host_set->dev = dev; | 4267 | host_set->dev = dev; |
@@ -4298,10 +4301,8 @@ int ata_device_add(const struct ata_probe_ent *ent) | |||
4298 | count++; | 4301 | count++; |
4299 | } | 4302 | } |
4300 | 4303 | ||
4301 | if (!count) { | 4304 | if (!count) |
4302 | kfree(host_set); | 4305 | goto err_free_ret; |
4303 | return 0; | ||
4304 | } | ||
4305 | 4306 | ||
4306 | /* obtain irq, that is shared between channels */ | 4307 | /* obtain irq, that is shared between channels */ |
4307 | if (request_irq(ent->irq, ent->port_ops->irq_handler, ent->irq_flags, | 4308 | if (request_irq(ent->irq, ent->port_ops->irq_handler, ent->irq_flags, |
@@ -4359,6 +4360,7 @@ err_out: | |||
4359 | ata_host_remove(host_set->ports[i], 1); | 4360 | ata_host_remove(host_set->ports[i], 1); |
4360 | scsi_host_put(host_set->ports[i]->host); | 4361 | scsi_host_put(host_set->ports[i]->host); |
4361 | } | 4362 | } |
4363 | err_free_ret: | ||
4362 | kfree(host_set); | 4364 | kfree(host_set); |
4363 | VPRINTK("EXIT, returning 0\n"); | 4365 | VPRINTK("EXIT, returning 0\n"); |
4364 | return 0; | 4366 | return 0; |
@@ -4468,15 +4470,13 @@ ata_probe_ent_alloc(struct device *dev, const struct ata_port_info *port) | |||
4468 | { | 4470 | { |
4469 | struct ata_probe_ent *probe_ent; | 4471 | struct ata_probe_ent *probe_ent; |
4470 | 4472 | ||
4471 | probe_ent = kmalloc(sizeof(*probe_ent), GFP_KERNEL); | 4473 | probe_ent = kzalloc(sizeof(*probe_ent), GFP_KERNEL); |
4472 | if (!probe_ent) { | 4474 | if (!probe_ent) { |
4473 | printk(KERN_ERR DRV_NAME "(%s): out of memory\n", | 4475 | printk(KERN_ERR DRV_NAME "(%s): out of memory\n", |
4474 | kobject_name(&(dev->kobj))); | 4476 | kobject_name(&(dev->kobj))); |
4475 | return NULL; | 4477 | return NULL; |
4476 | } | 4478 | } |
4477 | 4479 | ||
4478 | memset(probe_ent, 0, sizeof(*probe_ent)); | ||
4479 | |||
4480 | INIT_LIST_HEAD(&probe_ent->node); | 4480 | INIT_LIST_HEAD(&probe_ent->node); |
4481 | probe_ent->dev = dev; | 4481 | probe_ent->dev = dev; |
4482 | 4482 | ||