Bug 88971 - Possible memory leak in function (wil_write_file_wmi) not freeing pointer (wmi) on error path
Summary: Possible memory leak in function (wil_write_file_wmi) not freeing pointer (wm...
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Alan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-27 23:44 UTC by Ahmed Tamrawi
Modified: 2016-02-24 13:57 UTC (History)
3 users (show)

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


Attachments

Description Ahmed Tamrawi 2014-11-27 23:44:44 UTC
Function (wil_write_file_wmi) in file (drivers/net/wireless/ath/wil6210/debugfs.c) allocates pointer (wmi) on line (536) and passes it as a parameter to function (simple_write_to_buffer) at line (540). Function (simple_write_to_buffer) returns on line (539) with a negative value. This causes function (wil_write_file_wmi) to return on line (542) without freeing pointer (wmi). Thus, causing a possible memory leak not freeing pointer (wmi).

(wil_write_file_wmi) source code reference: http://lxr.free-electrons.com/source/drivers/net/wireless/ath/wil6210/debugfs.c#L523
(simple_write_to_buffer) source code reference: http://lxr.free-electrons.com/source/fs/libfs.c#L625
Comment 1 Alan 2014-12-08 15:51:21 UTC
Patch queued

Alan

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