Commit 3bb19dd4 authored by Petr Vandrovec's avatar Petr Vandrovec Committed by Greg Kroah-Hartman

[PATCH] drivers/ide/probe.c leaks memory

  drivers/ide/probe.c initializes gd->de_arr and gd->flags twice. Except that
it is unnecessary it also leaks memory.
parent e1d16022
......@@ -1173,18 +1173,6 @@ static void channel_init(struct ata_channel *ch)
gd->next = NULL; /* linked list of major devs */
gd->fops = ide_fops; /* file operations */
gd->de_arr = kmalloc(sizeof(*gd->de_arr) * MAX_DRIVES, GFP_KERNEL);
if (gd->de_arr)
memset(gd->de_arr, 0, sizeof(*gd->de_arr) * MAX_DRIVES);
else
goto err_kmalloc_gd_de_arr;
gd->flags = kmalloc(sizeof(*gd->flags) * MAX_DRIVES, GFP_KERNEL);
if (gd->flags)
memset(gd->flags, 0, sizeof(*gd->flags) * MAX_DRIVES);
else
goto err_kmalloc_gd_flags;
ch->gd = gd;
add_gendisk(gd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment