Bug 59961

Summary: [TRIVIAL]clk/sunxi/clk-sunxi.c:52: Two memory leaks ?
Product: Drivers Reporter: David Binderman (dcb314)
Component: OtherAssignee: drivers_other
Status: RESOLVED OBSOLETE    
Severity: normal CC: alan, xerofoify
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.10-rc6 Subsystem:
Regression: No Bisected commit-id:

Description David Binderman 2013-06-20 08:52:49 UTC
I just ran the static analysis checker "cppcheck" over the
source code of the 3.10-rc6. It said

[linux-3.10-rc6/drivers/clk/sunxi/clk-sunxi.c:52]: (error) Memory leak: fixed
[linux-3.10-rc6/drivers/clk/sunxi/clk-sunxi.c:52]: (error) Memory leak: gate

Source code is

    if (of_property_read_u32(node, "clock-frequency", &rate))
        return;

Suggest new code

    if (of_property_read_u32(node, "clock-frequency", &rate)) {
        kfree(fixed);
        kfree(gate);
        return;
    }
Comment 1 xerofoify 2014-06-14 01:49:48 UTC
Send it patch today to maintainers with the code fixed as stated here.
Cheers Nick
Comment 2 David Binderman 2014-06-14 06:57:07 UTC
>Send it patch today to maintainers with the code fixed as stated here.

Too late. Bug long since fixed.