In function (acm_probe) in file (drivers/usb/class/cdc-acm.c): Pointer (acm->country_codes) gets allocated in line (1404) and freed in lines (1414, 1424) if the call to function (device_create_file) fails (i < 0). However, if the conditions at (1413 and 1422) evaluates to false, the function (acm_probe) exists without freeing the pointer (acm->country_codes). Thus, causing a memory leak. Reference to function source code: http://lxr.free-electrons.com/source/drivers/usb/class/cdc-acm.c#L1404
On Thu, Nov 20, 2014 at 01:13:47AM +0000, bugzilla-daemon@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=88521 > > Bug ID: 88521 > Summary: Possible memory leak in acm_probe not freeing > (acm->country_codes) on error path Please just send to linux-usb@vger.kernel.org
This is intended behaviour. If all conditions (= sanity checks) fail, everything is OK and we can use country_codes in the driver. The memory gets later freed in acm_port_destruct(). Closing.