Messages in this thread |  | | Subject | Re: [PATCH 01/12] arm-cci: add missing of_node_put after of_device_is_available | From | Robin Murphy <> | Date | Tue, 16 Apr 2019 14:02:01 +0100 |
| |
On 14/04/2019 15:45, Markus Elfring wrote: >> @@ -538,8 +538,10 @@ static int cci_probe(void) >> struct resource res; >> >> np = of_find_matching_node(NULL, arm_cci_matches); >> - if (!of_device_is_available(np)) >> + if (!of_device_is_available(np)) { >> + of_node_put(np); >> return -ENODEV; >> + } >> >> ret = of_address_to_resource(np, 0, &res); >> if (!ret) { > > How do you think about to move this function call to an additional jump target > for the desired exception handling?
TBH it looks like the whole thing could do with a bit of refactoring - strictly we should probably be dropping the node reference in all the other failure paths too.
Robin.
|  |