提交 bd637f6f 编写于 作者: M Maxim Levitsky 提交者: David Woodhouse

mtd: mtd_blkdevs: fix double free on error path

This one liner patch fixes double free that will occur if add_mtd_blktrans_dev
fails. On failure it frees the input argument, but all its users also free it
on error which is natural thing to do. Thus don't free it.

All credit for finding that bug belongs to reporters of the bug in the android bugzilla
http://code.google.com/p/android/issues/detail?id=13761

Commit message tweaked by Artem.
Signed-off-by: NMaxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
Cc: stable@kernel.org
上级 82013d98
......@@ -413,7 +413,6 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
error2:
list_del(&new->list);
error1:
kfree(new);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册