Bug 11372

Summary: [linux-2.6/drivers/net/gianfar_mii.c:182]: Memory leak: new_bus
Product: Drivers Reporter: Daniel Marjamäki (danielm77)
Component: NetworkAssignee: Andy Fleming (afleming)
Status: RESOLVED PATCH_ALREADY_AVAILABLE    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: latest git tree Subsystem:
Regression: --- Bisected commit-id:
Attachments: Adds proper error-out paths

Description Daniel Marjamäki 2008-08-19 10:40:59 UTC
on line 167, new_bus is allocated.

If execution goes to line 182, new_bus will never be kfree'd.
Comment 1 Andy Fleming 2008-09-18 14:24:25 UTC
Bug description is misleading.  It's ok to not free if we get to 182, as that line indicates there was an error in *allocating* the memory.  However, I'm going to assume the line number was misreported, as there are several other places in this function that were recently changed, and now fail to properly free/iounmap memory after an error.  Patch forthcoming.
Comment 2 Andy Fleming 2008-09-18 14:43:52 UTC
Created attachment 17867 [details]
Adds proper error-out paths