提交 7d523187 编写于 作者: C Christophe Jaillet 提交者: Michael Ellerman

powerpc/nvram: Add missing kfree in error path

If 'nvram_write_header' fails, then 'new_part' should be freed, otherwise,
there is a memory leak.
Signed-off-by: NChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 2adc48a6
......@@ -1079,6 +1079,7 @@ loff_t __init nvram_create_partition(const char *name, int sig,
if (rc <= 0) {
pr_err("nvram_create_os_partition: nvram_write_header "
"failed (%d)\n", rc);
kfree(new_part);
return rc;
}
list_add_tail(&new_part->partition, &free_part->partition);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册