Message ID | 20191030092657.1237-1-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
Series | iASL: fix memory leak of LocalityBuffer on error return path | expand |
On 2019-10-30 3:26 a.m., Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > The error return path is not free'ing previously allocated > resource LocalityBuffer and hence there is a memory leak. Fix this > by free'ing it before returning. > > Fixes: c22c0b1df98c ("Data table compiler: Add error messages for SLIT locality buffers") > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/acpica/source/compiler/dttable2.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/acpica/source/compiler/dttable2.c b/src/acpica/source/compiler/dttable2.c > index bbaaafaa..550cca13 100644 > --- a/src/acpica/source/compiler/dttable2.c > +++ b/src/acpica/source/compiler/dttable2.c > @@ -1662,6 +1662,7 @@ DtCompileSlit ( > "Found %u entries, must match LocalityCount: %u", > LocalityListLength, Localities); > DtError (ASL_ERROR, ASL_MSG_ENTRY_LIST, EndOfFieldList, AslGbl_MsgBuffer); > + ACPI_FREE (LocalityBuffer); > return (AE_LIMIT); > } > > Acked-by: Alex Hung <alex.hung@canonical.com>
On 10/30/19 5:26 PM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > The error return path is not free'ing previously allocated > resource LocalityBuffer and hence there is a memory leak. Fix this > by free'ing it before returning. > > Fixes: c22c0b1df98c ("Data table compiler: Add error messages for SLIT locality buffers") > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/acpica/source/compiler/dttable2.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/acpica/source/compiler/dttable2.c b/src/acpica/source/compiler/dttable2.c > index bbaaafaa..550cca13 100644 > --- a/src/acpica/source/compiler/dttable2.c > +++ b/src/acpica/source/compiler/dttable2.c > @@ -1662,6 +1662,7 @@ DtCompileSlit ( > "Found %u entries, must match LocalityCount: %u", > LocalityListLength, Localities); > DtError (ASL_ERROR, ASL_MSG_ENTRY_LIST, EndOfFieldList, AslGbl_MsgBuffer); > + ACPI_FREE (LocalityBuffer); > return (AE_LIMIT); > } > Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/acpica/source/compiler/dttable2.c b/src/acpica/source/compiler/dttable2.c index bbaaafaa..550cca13 100644 --- a/src/acpica/source/compiler/dttable2.c +++ b/src/acpica/source/compiler/dttable2.c @@ -1662,6 +1662,7 @@ DtCompileSlit ( "Found %u entries, must match LocalityCount: %u", LocalityListLength, Localities); DtError (ASL_ERROR, ASL_MSG_ENTRY_LIST, EndOfFieldList, AslGbl_MsgBuffer); + ACPI_FREE (LocalityBuffer); return (AE_LIMIT); }