[PATCH v9 2/3] memory: Add STM32 Octo Memory Manager driver
Patrice CHOTARD
patrice.chotard at foss.st.com
Tue Apr 22 01:37:03 PDT 2025
On 4/15/25 08:00, Krzysztof Kozlowski wrote:
> On 10/04/2025 11:27, Patrice Chotard wrote:
>> + for (i = 0; i < omm->nb_child; i++) {
>> + idx = of_property_match_string(dev->of_node,
>> + "memory-region-names",
>> + mm_name[i]);
>> + if (idx < 0)
>> + continue;
>> +
>> + /* res1 only used on second loop iteration */
>> + res1.start = res.start;
>> + res1.end = res.end;
>> +
>> + node = of_parse_phandle(dev->of_node, "memory-region", idx);
>> + if (!node)
>> + continue;
>> +
>> + ret = of_address_to_resource(node, 0, &res);
>> + if (ret) {
>> + of_node_put(node);
>> + dev_err(dev, "unable to resolve memory region\n");
>> + return ret;
>> + }
>> +
>> + /* check that memory region fits inside OMM memory map area */
>> + if (!resource_contains(omm->mm_res, &res)) {
>> + dev_err(dev, "%s doesn't fit inside OMM memory map area\n",
>> + mm_name[i]);
>> + dev_err(dev, "%pR doesn't fit inside %pR\n", &res, omm->mm_res);
>> +
>
> I don't understand. I already pointed out that you leak OF reference.
> You fixed it in one place, ignoring all the rest. You must fix it
> everywhere.
>
Hi Krzysztof
My bad, i will add all missing of_node_put().
Thanks
Patrice
>> + return -EFAULT;
>> + }
>> +
>
>
> Best regards,
> Krzysztof
More information about the linux-arm-kernel
mailing list