提交 05480380 编写于 作者: N Navid Emamdoost 提交者: Xie XiuQi

iwlwifi: dbg_ini: fix memory leak in alloc_sgtable

mainline inclusion
from mainline-v5.4-rc6
commit b4b814fec1a5a849383f7b3886b654a13abbda7d
category: bugfix
bugzilla: 13690
CVE: CVE-2019-19058

-------------------------------------------------

In alloc_sgtable if alloc_page fails, the alocated table should be
released.
Signed-off-by: NNavid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NWenan Mao <maowenan@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 abc9c6ac
...@@ -547,6 +547,7 @@ static struct scatterlist *alloc_sgtable(int size) ...@@ -547,6 +547,7 @@ static struct scatterlist *alloc_sgtable(int size)
if (new_page) if (new_page)
__free_page(new_page); __free_page(new_page);
} }
kfree(table);
return NULL; return NULL;
} }
alloc_size = min_t(int, size, PAGE_SIZE); alloc_size = min_t(int, size, PAGE_SIZE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册