Re: [PATCH] fsi: Aspeed: Fix a potential double free

From
Dan Carpenter <hidden>
Date
2022-01-06 08:15:12
Also in
kernel-janitors, linux-aspeed, lkml
Reply to
Greg KH, 2021-12-27
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:
quoted
'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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (7 messages) 7 messages, 4 authors, last reply 2022-01-07
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help