Bug 88971

Summary: Possible memory leak in function (wil_write_file_wmi) not freeing pointer (wmi) on error path
Product: Drivers Reporter: Ahmed Tamrawi (atamrawi)
Component: network-wirelessAssignee: Alan (alan)
Status: RESOLVED CODE_FIX    
Severity: normal CC: alan, linville, vladimirkondratyev
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.17-rc1 Subsystem:
Regression: No Bisected commit-id:

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