1
0
Fork 0

MGS-5176-2 [#imx-1744] Need free the pages if malloc memory failed

When alloc NonContiguous1MPages, if malloc fail, need free the pages to avoid memory leak

Date: 24 Oct, 2019
Signed-off-by: Xianzhong Li <xianzhong.li@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Ella Feng 2019-10-24 23:10:15 +08:00 committed by Dong Aisheng
parent ce7c0558a8
commit 80b7bdd8b4
1 changed files with 2 additions and 0 deletions

View File

@ -424,6 +424,7 @@ _NonContiguous1MPagesAlloc(
if (order >= MAX_ORDER)
{
kfree(pages);
_NonContiguous1MPagesFree(MdlPriv, MdlPriv->numPages1M);
return gcvNULL;
}
@ -433,6 +434,7 @@ _NonContiguous1MPagesAlloc(
if (MdlPriv->Pages1M[i] == gcvNULL)
{
kfree(pages);
_NonContiguous1MPagesFree(MdlPriv, MdlPriv->numPages1M);
return gcvNULL;
}