[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0ed85d5f-f1b2-4b9c-8817-193ae98ce286@linux.microsoft.com>
Date: Thu, 10 Apr 2025 15:29:21 -0700
From: Vijay Balakrishna <vijayb@...ux.microsoft.com>
To: "Tyler Hicks (Microsoft)" <code@...icks.com>
Cc: Borislav Petkov <bp@...en8.de>, Tony Luck <tony.luck@...el.com>,
James Morse <james.morse@....com>, Mauro Carvalho Chehab
<mchehab@...nel.org>, Robert Richter <rric@...nel.org>,
linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
Marc Zyngier <maz@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>
Subject: Re: [PATCH 1/2] drivers/edac: Add L1 and L2 error detection for A53,
A57 and A72
On 4/10/2025 1:04 PM, Tyler Hicks (Microsoft) wrote:
>> +static int __init cortex_arm64_edac_driver_init(void)
>> +{
>> + struct device_node *np;
>> + int cpu;
>> + struct platform_device *pdev;
>> + int err;
>> +
>> + for_each_possible_cpu(cpu) {
>> + np = of_get_cpu_node(cpu, NULL);
> Copilot correctly points out that we don't check np for NULL here. I think
> of_match_node() handles that fine but we get fairly deep into the call stack
> before it is caught. Let's go ahead and proactive check the return value.
>
> More importantly, it pointed out that we don't call of_node_put(np) before
> moving onto the next CPU. This would result in a refcount issue and will need
> to be fixed.
Good catch. Let me change in next version.
Thanks,
Vijay
Powered by blists - more mailing lists