On 01/10/2024 22:09, Zichen Xie wrote: > I don't think device_node() is a correct freeing function here: > 'struct device_node *np __free(device_node);' > even if I'm not an expert in Kernel. > > And I think it could be more convincing to explain 'why', rather than > simply highlighting the errors repeatedly. If you ever bothered to compile your code, you would see why. None of your arguments make any sense. Your code tries to perform initialization, just before assignment so it is completely unnecessary. I don't understand why you could not spot that obvious part of the code, because this is just C. For obvious reasons I won't be spending my time to explain why this: some_ptr *ptr = NULL; ptr = foo; if () ... return ...; is wrong. You just did not read the code, not built it. Best regards, Krzysztof