Re: [PATCHv2 3/4] EDAC/altera: Fix code leak on dci allocation failure

From: Rounak Das

Date: Thu Aug 06 2026 - 14:17:21 EST


Hi Dinh,

> - if (!devres_open_group(device->edac->dev, altr_portb_setup, GFP_KERNEL))
> + if (!devres_open_group(device->edac->dev, altr_portb_setup, GFP_KERNEL)) {
> + edac_device_free_ctl_info(dci);
> return -ENOMEM;
> + }

This overlaps with my of_node_put fix that was acked on 2026-07-20
(20260717131720.19038-1-rounakdas2025@xxxxxxxxx), which was held
until the sashiko issues were addressed.

Patches 3/4 and 4/4 touch the same two hunks in altr_portb_setup(): the
devres_open_group() failure path and the err_release_group_1 label. Both
changes are needed in the first one, i.e.

if (!devres_open_group(...)) {
edac_device_free_ctl_info(dci);
of_node_put(np);
return -ENOMEM;
}

so whichever goes in second will need a rebase. Happy to resend mine on
top of this series if that ordering is easier.

Thanks,
Rounak