diff options
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r-- | drivers/ide/ide-probe.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index c1128ae5cd2f..02167a5b751d 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) | |||
596 | * Also note that 0 everywhere means "can't do X" | 596 | * Also note that 0 everywhere means "can't do X" |
597 | */ | 597 | */ |
598 | 598 | ||
599 | drive->id = kmalloc(SECTOR_WORDS *4, GFP_KERNEL); | 599 | drive->id = kzalloc(SECTOR_WORDS *4, GFP_KERNEL); |
600 | drive->id_read = 0; | 600 | drive->id_read = 0; |
601 | if(drive->id == NULL) | 601 | if(drive->id == NULL) |
602 | { | 602 | { |
603 | printk(KERN_ERR "ide: out of memory for id data.\n"); | 603 | printk(KERN_ERR "ide: out of memory for id data.\n"); |
604 | return 0; | 604 | return 0; |
605 | } | 605 | } |
606 | memset(drive->id, 0, SECTOR_WORDS * 4); | ||
607 | strcpy(drive->id->model, "UNKNOWN"); | 606 | strcpy(drive->id->model, "UNKNOWN"); |
608 | 607 | ||
609 | /* skip probing? */ | 608 | /* skip probing? */ |
@@ -1316,10 +1315,8 @@ static void drive_release_dev (struct device *dev) | |||
1316 | drive->devfs_name[0] = '\0'; | 1315 | drive->devfs_name[0] = '\0'; |
1317 | } | 1316 | } |
1318 | ide_remove_drive_from_hwgroup(drive); | 1317 | ide_remove_drive_from_hwgroup(drive); |
1319 | if (drive->id != NULL) { | 1318 | kfree(drive->id); |
1320 | kfree(drive->id); | 1319 | drive->id = NULL; |
1321 | drive->id = NULL; | ||
1322 | } | ||
1323 | drive->present = 0; | 1320 | drive->present = 0; |
1324 | /* Messed up locking ... */ | 1321 | /* Messed up locking ... */ |
1325 | spin_unlock_irq(&ide_lock); | 1322 | spin_unlock_irq(&ide_lock); |