+static int __init cortex_arm64_edac_driver_init(void)Copilot correctly points out that we don't check np for NULL here. I think
+{
+ struct device_node *np;
+ int cpu;
+ struct platform_device *pdev;
+ int err;
+
+ for_each_possible_cpu(cpu) {
+ np = of_get_cpu_node(cpu, NULL);
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.