[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250918100855.GAaMvaN7wCauxpD9Uk@fat_crate.local>
Date: Thu, 18 Sep 2025 12:09:09 +0200
From: Borislav Petkov <bp@...en8.de>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Shubhrajyoti Datta <shubhrajyoti.datta@....com>,
linux-edac@...r.kernel.org, lkml <linux-kernel@...r.kernel.org>
Subject: Re: [bug report] EDAC: Add a driver for the AMD Versal NET DDR
controller
On Thu, Sep 18, 2025 at 09:55:52AM +0300, Dan Carpenter wrote:
> Hello Shubhrajyoti Datta,
>
> Commit d5fe2fec6c40 ("EDAC: Add a driver for the AMD Versal NET DDR
> controller") from Sep 8, 2025 (linux-next), leads to the following
> Smatch static checker warning:
>
> drivers/edac/versalnet_edac.c:849 init_versalnet()
> warn: '_res' from device_register() not released on lines: 849.
_res?
No _res there.
In any case, this mess is probably due to me trying to salvage a crap
situation already.
The proper fix is carving out the loop body into a __init_versalnet_mc() or so
function which does the allocation and everything along with goto labels for
error path for a *single* memory controller.
And then add another function which unwinds and frees everything, perhaps
__free_versalnet_mc().
Then this init_versalnet() function would only run the loop and call the
__init one. If the __init one returns an error, it would do the unwinding
using the __free one.
Sounds like a plan?
Would you like to give it a try and run your tool ontop to verify?
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists