RE: [PATCH iwl-net v1] idpf: fix lan_regs leak on core init failure

From: Jagielski, Jedrzej

Date: Mon Jul 06 2026 - 06:05:30 EST


From: xuanqiang.luo@xxxxxxxxx <xuanqiang.luo@xxxxxxxxx>
Sent: Friday, July 3, 2026 12:42 PM

>From: Xuanqiang Luo <luoxuanqiang@xxxxxxxxxx>
>
>idpf_vc_core_init() gets the LAN memory region layout before mapping the
>regions and allocating vport resources. Both layout paths allocate
>hw->lan_regs, but later error paths return without freeing it.
>
>idpf_vc_core_deinit() does not cover these paths because it returns unless
>IDPF_VC_CORE_INIT is set, and that bit is set only after core init
>succeeds.
>
>Free hw->lan_regs on the post-allocation error paths and clear the
>pointer and region count.
>
>Fixes: 6aa53e861c1a ("idpf: implement get LAN MMIO memory regions")
>Signed-off-by: Xuanqiang Luo <luoxuanqiang@xxxxxxxxxx>


Looks fine, thanks for the patch!

Reviewed-by: Jedrzej Jagielski <jedrzej.jagielski@xxxxxxxxx>