Messages in this thread | | | From | Bartlomiej Zolnierkiewicz <> | Subject | Re: [PATCH] ide: Two fixes regarding memory allocation | Date | Sun, 31 Aug 2008 18:05:56 +0200 |
| |
On Friday 29 August 2008, Elias Oltmanns wrote: > In function ide_devset_execute() we should use __GFP_WAIT rather than > GFP_KERNEL. Also, the allocation cannot possibly fail at that point. > More importantly, there is a potential memory leak in the device probing > code. The infrastructure seems rather complex and I hope I haven't messed > anything up by trying to fix this. > > Signed-off-by: Elias Oltmanns <eo@nebensachen.de>
thanks, applied
> @@ -972,12 +972,21 @@ static void ide_port_setup_devices(ide_hwif_t *hwif) > if (ide_init_queue(drive)) { > printk(KERN_ERR "ide: failed to init %s\n", > drive->name); > + spin_lock_irq(&ide_lock); > + kfree(drive->id); > + drive->id = NULL; > + drive->dev_flags &= ~IDE_DFLAG_PRESENT; > + spin_unlock_irq(&ide_lock); > continue;
ide_lock taking is superfluous here, I removed it while merging the patch
| |