lkml.org 
[lkml]   [2022]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fsi: Aspeed: Fix a potential double free
On Mon, Dec 27, 2021 at 07:29:07AM +0100, Greg KH wrote:
> On Sun, Dec 26, 2021 at 05:56:02PM +0100, Christophe JAILLET wrote:
> > 'aspeed' is a devm_alloc'ed, so there is no need to free it explicitly or
> > there will be a double free().
>
> A struct device can never be devm_alloced for obvious reasons. Perhaps
> that is the real problem here?
>

I don't understand how "aspeed" is a struct device.

I've been working on understanding device managed memory recently for
Smatch. It's really complicated. There are a bunch of rules/heuristics
that I'm slowly creating to generate new warnings but I'm a long way
from understanding it well myself.

regards,
dan carpenter

\
 
 \ /
  Last update: 2022-01-06 09:15    [W:0.064 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site