Bug 11372 - [linux-2.6/drivers/net/gianfar_mii.c:182]: Memory leak: new_bus
Summary: [linux-2.6/drivers/net/gianfar_mii.c:182]: Memory leak: new_bus
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: Drivers
Classification: Unclassified
Component: Network (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Andy Fleming
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-19 10:40 UTC by Daniel Marjamäki
Modified: 2008-09-18 14:44 UTC (History)
0 users

See Also:
Kernel Version: latest git tree
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
Adds proper error-out paths (1.26 KB, patch)
2008-09-18 14:43 UTC, Andy Fleming
Details | Diff

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

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