Bug 15490 - [cppcheck] found a memory leak in linux-2.6/drivers/acpi/ec.c
Summary: [cppcheck] found a memory leak in linux-2.6/drivers/acpi/ec.c
Status: CLOSED INVALID
Alias: None
Product: ACPI
Classification: Unclassified
Component: EC (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: acpi_ec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-09 14:35 UTC by Martin Ettl
Modified: 2010-04-04 00:26 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.34 git head
Subsystem:
Regression: No
Bisected commit-id:


Attachments
fix (392 bytes, patch)
2010-03-09 14:35 UTC, Martin Ettl
Details | Diff

Description Martin Ettl 2010-03-09 14:35:33 UTC
Created attachment 25423 [details]
fix 

during a check of the current git head of the linux kernel with the static code
analysis tool cppcheck
(http://sourceforge.net/apps/mediawiki/cppcheck/index.php?title=Main_Page) the
tool discovered a memory leak in linux-2.6/drivers/acpi/ec.c

Please refer the attached patch, that fixes the issue.

Best regards

Ettl Martin
Comment 1 Alexey Starikovskiy 2010-03-09 14:47:27 UTC
There is no memory leak. This was already discussed.
Comment 2 Martin Ettl 2010-03-09 14:54:30 UTC
Where was it already discussed?
Comment 3 Alexey Starikovskiy 2010-03-09 15:56:46 UTC
bugzilla-daemon@bugzilla.kernel.org пишет:
> --- Comment #2 from Martin Ettl <ettl.martin@gmx.de>  2010-03-09 14:54:30 ---
> Where was it already discussed?
On kernel-janitors@vger.kernel.org mail list.
Comment 4 Martin Ettl 2010-03-09 16:50:52 UTC
Is it a false positive of cppcheck? If so, i can report it to the developers. Please tell me why this is no memory leak?

<!--                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      -->

-------- Original-Nachricht --------
> Datum: Tue, 9 Mar 2010 14:47:29 GMT
> Von: bugzilla-daemon@bugzilla.kernel.org
> An: ettl.martin@gmx.de
> Betreff: [Bug 15490] [cppcheck] found a memory leak in
> linux-2.6/drivers/acpi/ec.c

> http://bugzilla.kernel.org/show_bug.cgi?id=15490
> 
> 
> Alexey Starikovskiy <astarikovskiy@suse.de> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|NEW                         |RESOLVED
>                  CC|                            |astarikovskiy@suse.de
>          Resolution|                            |INVALID
> 
> 
> 
> 
> --- Comment #1 from Alexey Starikovskiy <astarikovskiy@suse.de> 
> 2010-03-09 14:47:27 ---
> There is no memory leak. This was already discussed.
> 
> -- 
> Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.
Comment 5 Alexey Starikovskiy 2010-03-09 17:16:15 UTC
saved_ec is allocated only if flag EC_FLAGS_VALIDATE_ECDT is set. There is no sense to set this flag and then forbid reading of DSDT with EC_FLAGS_SKIP_DSDT_SCAN.
Comment 6 Martin Ettl 2010-03-09 17:48:22 UTC
Ok, i see. Thank you for you explanation.

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