Thread (14 messages) 14 messages, 4 authors, 10d ago

Re: [PATCH v2 2/2] net: fman: use devm_kzalloc() for fman and rely on devres

From: ZhaoJinming <hidden>
Date: 2026-06-24 09:52:42
Also in: lkml

Thank you for the feedback. I fully understand the concern about
devm_ conversions. I have reworked the patch to avoid the devm_kzalloc()
approach entirely. The new version explicitly calls devm_free_irq() on
the error paths before kfree(fman), keeping the original kzalloc_obj()
allocation unchanged. The fix targets the same UAF problem but without
introducing any devm_ allocation conversion.

v3:
  - Drop devm_kzalloc() approach
  - Fix by explicitly calling devm_free_irq() before kfree(fman)
    on all post-IRQ-registration error paths
  - Add conditional check for err_irq before devm_free_irq() in
    read_dts_node() to handle the case where err_irq is not registered

Best regards,
ZhaoJinming

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help