Bug 15490

Summary: [cppcheck] found a memory leak in linux-2.6/drivers/acpi/ec.c
Product: ACPI Reporter: Martin Ettl (ettl.martin)
Component: ECAssignee: acpi_ec
Status: CLOSED INVALID    
Severity: normal CC: astarikovskiy, lenb
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.34 git head Subsystem:
Regression: No Bisected commit-id:
Attachments: fix

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.