Bug 89101 - Possible memory leak in function (reserve_range) not freeing pointer (regionid)
Summary: Possible memory leak in function (reserve_range) not freeing pointer (regionid)
Status: RESOLVED WILL_NOT_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: PNP (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Adam Belay
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-30 19:45 UTC by Ahmed Tamrawi
Modified: 2014-12-08 15:38 UTC (History)
1 user (show)

See Also:
Kernel Version: 3.17-rc1
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Ahmed Tamrawi 2014-11-30 19:45:26 UTC
Function (reserve_range) in file (drivers/pnp/system.c) allocates pointer (regionid) on line (32) and passes it to function (__request_region) through the macros: (request_region) at line (38) or (request_mem_region) at line (40). However, if the resource (res) is allocated through (__request_region) function, then the pointer (res->name) points to the allocated pointer (regionid). Then, there is no way in function (free_resource) or function (release_resource) to free the pointer (regionid) or (res->name). Thus, causing a potential memory leak!

Function (reserve_range) source code reference: http://lxr.free-electrons.com/source/drivers/pnp/system.c#L25
Function (free_resource) source code reference:http://lxr.free-electrons.com/source/kernel/resource.c#L172
Function (release_resource) source code reference:http://lxr.free-electrons.com/source/kernel/resource.c#L322
Comment 1 Alan 2014-12-08 15:38:08 UTC
We never upload the reserved regions so while true, I don't think it matters

Note You need to log in before you can comment on or make changes to this bug.