X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fide%2Fide-probe.c;h=02167a5b751dbe40a0b1be304766903fceb43c52;hb=89de09a9ba9ce293228b1f1aa3c68b5af33a70ce;hp=5d876f53c69735d53c6d9b13a42eed559294d5b9;hpb=ae20ea8525a80a863f70d332cf47b71bd9f54c1f;p=linux-2.6 diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 5d876f53c6..02167a5b75 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -596,14 +596,13 @@ static inline u8 probe_for_drive (ide_drive_t *drive) * Also note that 0 everywhere means "can't do X" */ - drive->id = kmalloc(SECTOR_WORDS *4, GFP_KERNEL); + drive->id = kzalloc(SECTOR_WORDS *4, GFP_KERNEL); drive->id_read = 0; if(drive->id == NULL) { printk(KERN_ERR "ide: out of memory for id data.\n"); return 0; } - memset(drive->id, 0, SECTOR_WORDS * 4); strcpy(drive->id->model, "UNKNOWN"); /* skip probing? */ @@ -977,8 +976,8 @@ static int ide_init_queue(ide_drive_t *drive) * limits and LBA48 we could raise it but as yet * do not. */ - - q = blk_init_queue(do_ide_request, &ide_lock); + + q = blk_init_queue_node(do_ide_request, &ide_lock, hwif_to_node(hwif)); if (!q) return 1; @@ -1047,6 +1046,8 @@ static int init_irq (ide_hwif_t *hwif) BUG_ON(in_interrupt()); BUG_ON(irqs_disabled()); + BUG_ON(hwif == NULL); + down(&ide_cfg_sem); hwif->hwgroup = NULL; #if MAX_HWIFS > 1 @@ -1095,7 +1096,8 @@ static int init_irq (ide_hwif_t *hwif) hwgroup->hwif->next = hwif; spin_unlock_irq(&ide_lock); } else { - hwgroup = kmalloc(sizeof(ide_hwgroup_t),GFP_KERNEL); + hwgroup = kmalloc_node(sizeof(ide_hwgroup_t), GFP_KERNEL, + hwif_to_node(hwif->drives[0].hwif)); if (!hwgroup) goto out_up; @@ -1313,10 +1315,8 @@ static void drive_release_dev (struct device *dev) drive->devfs_name[0] = '\0'; } ide_remove_drive_from_hwgroup(drive); - if (drive->id != NULL) { - kfree(drive->id); - drive->id = NULL; - } + kfree(drive->id); + drive->id = NULL; drive->present = 0; /* Messed up locking ... */ spin_unlock_irq(&ide_lock);