[dpdk-dev] [PATCH] power: fix use-after-free in pstate code

Thomas Monjalon thomas at monjalon.net
Thu Apr 15 23:29:51 CEST 2021


07/04/2021 18:10, David Hunt:
> Hi Anatoly,
> 
> On 7/4/2021 4:56 PM, Anatoly Burakov wrote:
> > Previous fix has addressed the incorrect handling of `base_frequency`
> > file, but has added a use-after-free error due to the fact that all
> > further code paths will lead to an `fclose()` call at the end, so the
> > additional `fclose()` call right after processing the file was
> > unnecessary.
> >
> > Coverity issue: 369901
> >
> > Fixes: 8a5febaac4f7 ("power: fix P-state base frequency handling")
> >
> > Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
> 
> Yes, removing the fclose will do it. Either that or add an "f_base = 
> NULL" after the fclose, but the fclose removal is fine.
> 
> Acked-by: David Hunt <david.hunt at intel.com>

Applied, thanks




More information about the dev mailing list