lkml.org 
[lkml]   [2008]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] ide: Two fixes regarding memory allocation
Date
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


\
 
 \ /
  Last update: 2008-08-31 18:13    [W:0.158 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site