提交 009484c9 编写于 作者: N Navid Emamdoost 提交者: Greg Kroah-Hartman

dma-buf: Fix memory leak in sync_file_merge()

commit 6645d42d79d33e8a9fe262660a75d5f4556bbea9 upstream.

In the implementation of sync_file_merge() the allocated sync_file is
leaked if number of fences overflows. Release sync_file by goto err.

Fixes: a02b9dc9 ("dma-buf/sync_file: refactor fence storage in struct sync_file")
Signed-off-by: NNavid Emamdoost <navid.emamdoost@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20191122220957.30427-1-navid.emamdoost@gmail.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 73155507
...@@ -230,7 +230,7 @@ static struct sync_file *sync_file_merge(const char *name, struct sync_file *a, ...@@ -230,7 +230,7 @@ static struct sync_file *sync_file_merge(const char *name, struct sync_file *a,
a_fences = get_fences(a, &a_num_fences); a_fences = get_fences(a, &a_num_fences);
b_fences = get_fences(b, &b_num_fences); b_fences = get_fences(b, &b_num_fences);
if (a_num_fences > INT_MAX - b_num_fences) if (a_num_fences > INT_MAX - b_num_fences)
return NULL; goto err;
num_fences = a_num_fences + b_num_fences; num_fences = a_num_fences + b_num_fences;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册