android_kernel_xiaomi_sm8350/drivers/acpi/acpica
Lin Ming a5fe1a03f7 ACPICA: fix leak of acpi_os_validate_address
http://bugzilla.kernel.org/show_bug.cgi?id=13620

If the dynamic region is created and added to resource list over and over again,
it has the potential to be a memory leak by growing the list every time.

This patch fixes the memory leak, as below

1) add a new field "count" to struct acpi_res_list.

   When inserting, if the region(addr, len) is already in the resource
   list, we just increase "count", otherwise, the region is inserted
   with count=1.

   When deleting, the "count" is decreased, if it's decreased to 0,
   the region is deleted from the resource list.

   With "count", the region with same address and length can only be
   inserted to the resource list once, so prevent potential memory leak.

2) add a new function acpi_os_invalidate_address, which is called when
   region is deleted.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-08-27 13:10:35 -04:00
..
accommon.h
acconfig.h
acdebug.h
acdispat.h
acevents.h ACPICA: Simplify internal operation region interface 2009-05-27 00:35:51 -04:00
acglobal.h ACPICA: Remove unused global variables 2009-05-27 00:30:48 -04:00
achware.h ACPICA: New: I/O port protection 2009-03-27 12:11:03 -04:00
acinterp.h
aclocal.h ACPICA: Disable preservation of SCI enable bit (SCI_EN) 2009-05-27 00:41:34 -04:00
acmacros.h ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
acnamesp.h ACPICA: Simplify and optimize NsGetNextNode function 2009-05-27 00:35:50 -04:00
acobject.h Revert "ACPICA: Remove obsolete acpi_os_validate_address interface" 2009-07-27 18:42:38 -04:00
acopcode.h
acparser.h
acpredef.h ACPICA: Update comments in module header 2009-03-26 16:38:23 -04:00
acresrc.h
acstruct.h
actables.h ACPICA: Fix AcpiWalkNamespace race condition with table unload 2009-03-27 12:11:02 -04:00
acutils.h ACPICA: Fix AcpiWalkNamespace race condition with table unload 2009-03-27 12:11:02 -04:00
amlcode.h ACPICA: New: AcpiInstallMethod - install a single control method 2009-05-27 00:35:51 -04:00
amlresrc.h
dsfield.c
dsinit.c ACPICA: Fix AcpiWalkNamespace race condition with table unload 2009-03-27 12:11:02 -04:00
dsmethod.c
dsmthdat.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
dsobject.c ACPICA: Fix miscellaneous warnings under gcc 4+ 2009-05-27 00:30:49 -04:00
dsopcode.c Revert "ACPICA: Remove obsolete acpi_os_validate_address interface" 2009-07-27 18:42:38 -04:00
dsutils.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
dswexec.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
dswload.c
dswscope.c
dswstate.c ACPICA: Fix miscellaneous warnings under gcc 4+ 2009-05-27 00:30:49 -04:00
evevent.c ACPICA: Add manifest constants for bit register values 2009-03-27 12:11:01 -04:00
evgpe.c ACPICA: Formatting update - no functional changes 2009-03-27 12:11:02 -04:00
evgpeblk.c ACPICA: Formatting update - no functional changes 2009-03-27 12:11:02 -04:00
evmisc.c ACPICA: Formatting update - no functional changes 2009-03-27 12:11:02 -04:00
evregion.c ACPICA: Simplify internal operation region interface 2009-05-27 00:35:51 -04:00
evrgnini.c ACPICA: Formatting update - no functional changes 2009-03-27 12:11:02 -04:00
evsci.c
evxface.c ACPICA: Formatting update - no functional changes 2009-03-27 12:11:02 -04:00
evxfevnt.c ACPICA: Miscellaneous lint changes 2009-05-27 00:30:49 -04:00
evxfregn.c ACPICA: Formatting update - no functional changes 2009-03-27 12:11:02 -04:00
exconfig.c ACPICA: Simplify internal operation region interface 2009-05-27 00:35:51 -04:00
exconvrt.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
excreate.c ACPICA: New: AcpiInstallMethod - install a single control method 2009-05-27 00:35:51 -04:00
exdump.c ACPICA: New: AcpiInstallMethod - install a single control method 2009-05-27 00:35:51 -04:00
exfield.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
exfldio.c Revert "ACPICA: Remove obsolete acpi_os_validate_address interface" 2009-07-27 18:42:38 -04:00
exmisc.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
exmutex.c ACPICA: Fix allowable release order for ASL mutex objects 2009-05-27 00:32:24 -04:00
exnames.c
exoparg1.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
exoparg2.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
exoparg3.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
exoparg6.c
exprep.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
exregion.c ACPICA: New: I/O port protection 2009-03-27 12:11:03 -04:00
exresnte.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
exresolv.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
exresop.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
exstore.c ACPICA: Fix DebugObject output for DdbHandle objects 2009-05-27 00:32:24 -04:00
exstoren.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
exstorob.c
exsystem.c
exutils.c ACPICA: Remove ACPI_GET_OBJECT_TYPE macro 2009-03-26 16:38:27 -04:00
hwacpi.c ACPICA: New: I/O port protection 2009-03-27 12:11:03 -04:00
hwgpe.c ACPICA: Formatting update - no functional changes 2009-03-27 12:11:02 -04:00
hwregs.c ACPICA: Fix a few warnings for gcc 3.4.4 2009-05-27 00:30:48 -04:00
hwsleep.c ACPI: Disable _GTS and _BFS support by default 2009-04-17 23:32:20 -04:00
hwtimer.c
hwvalid.c Revert "ACPICA: delete check for AML access to port 0x81-83" 2009-04-24 00:32:52 -04:00
hwxface.c ACPICA: New: I/O port protection 2009-03-27 12:11:03 -04:00
Makefile ACPICA: use acpi.* modparam namespace 2009-05-07 15:24:31 -04:00
nsaccess.c ACPICA: Formatting update - no functional changes 2009-03-27 12:11:02 -04:00
nsalloc.c ACPICA: Simplify and optimize NsGetNextNode function 2009-05-27 00:35:50 -04:00
nsdump.c ACPICA: Formatting update - no functional changes 2009-03-27 12:11:02 -04:00
nsdumpdv.c
nseval.c ACPICA: Debug output: decrease verbosity of DB_INFO debug level 2009-03-26 16:38:29 -04:00
nsinit.c ACPICA: Formatting update - no functional changes 2009-03-27 12:11:02 -04:00
nsload.c ACPICA: Formatting update - no functional changes 2009-03-27 12:11:02 -04:00
nsnames.c ACPICA: Fix printf format warnings for 64-bit build 2009-05-27 00:30:49 -04:00
nsobject.c ACPICA: New: AcpiInstallMethod - install a single control method 2009-05-27 00:35:51 -04:00
nsparse.c ACPICA: Formatting update - no functional changes 2009-03-27 12:11:02 -04:00
nspredef.c ACPICA: Fix possible dereference of null pointer 2009-05-27 00:30:49 -04:00
nssearch.c ACPICA: Miscellaneous lint changes 2009-05-27 00:30:49 -04:00
nsutils.c ACPICA: Formatting update - no functional changes 2009-03-27 12:11:02 -04:00
nswalk.c ACPICA: Simplify and optimize NsGetNextNode function 2009-05-27 00:35:50 -04:00
nsxfeval.c hwmon: Add Asus ATK0110 support 2009-04-07 15:32:59 +02:00
nsxfname.c ACPICA: New: AcpiInstallMethod - install a single control method 2009-05-27 00:35:51 -04:00
nsxfobj.c ACPICA: Eliminate extra call to NsGetParentNode 2009-05-27 00:35:51 -04:00
psargs.c
psloop.c
psopcode.c
psparse.c
psscope.c
pstree.c
psutils.c
pswalk.c
psxface.c
rsaddr.c
rscalc.c ACPICA: Additional validation of _PRT packages (resource mgr) 2009-05-27 00:35:50 -04:00
rscreate.c ACPI: Revert conflicting workaround for BIOS w/ mangled PRT entries 2009-04-11 00:57:21 -04:00
rsdump.c
rsinfo.c
rsio.c
rsirq.c
rslist.c
rsmemory.c
rsmisc.c
rsutils.c
rsxface.c ACPICA: Fix miscellaneous warnings under gcc 4+ 2009-05-27 00:30:49 -04:00
tbfadt.c ACPICA: Miscellaneous lint changes 2009-05-27 00:30:49 -04:00
tbfind.c
tbinstal.c ACPICA: Miscellaneous lint changes 2009-05-27 00:30:49 -04:00
tbutils.c ACPICA: Update table header print function 2009-03-26 16:38:32 -04:00
tbxface.c Merge branch 'linus' into release 2009-04-05 02:14:15 -04:00
tbxfroot.c ACPICA: Formatting update - no functional changes 2009-03-26 16:38:29 -04:00
utalloc.c
utcopy.c ACPICA: Change behavior of object copy for mutex/event objects 2009-05-27 00:30:48 -04:00
utdebug.c ACPICA: Fix possible warnings for ACPI_THREAD_ID on 64-bit build 2009-05-27 00:30:48 -04:00
utdelete.c ACPICA: fix leak of acpi_os_validate_address 2009-08-27 13:10:35 -04:00
uteval.c ACPICA: New: I/O port protection 2009-03-27 12:11:03 -04:00
utglobal.c ACPICA: New: I/O port protection 2009-03-27 12:11:03 -04:00
utinit.c
utlock.c ACPICA: Fix AcpiWalkNamespace race condition with table unload 2009-03-27 12:11:02 -04:00
utmath.c
utmisc.c ACPICA: Update error/warning interfaces 2009-05-27 00:30:48 -04:00
utmutex.c ACPICA: Fix possible warnings for ACPI_THREAD_ID on 64-bit build 2009-05-27 00:30:48 -04:00
utobject.c ACPICA: Debug output: decrease verbosity of DB_INFO debug level 2009-03-26 16:38:29 -04:00
utresrc.c
utstate.c
utxface.c