Bug 59961 - [TRIVIAL]clk/sunxi/clk-sunxi.c:52: Two memory leaks ?
Summary: [TRIVIAL]clk/sunxi/clk-sunxi.c:52: Two memory leaks ?
Status: RESOLVED OBSOLETE
Alias: None
Product: Drivers
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-20 08:52 UTC by David Binderman
Modified: 2014-06-14 06:57 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.10-rc6
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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.

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