* [bug report] kho: update FDT dynamically for subtree addition/removal
@ 2026-03-03 5:16 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2026-03-03 5:16 UTC (permalink / raw)
To: Pasha Tatashin; +Cc: kexec, linux-mm
[ Smatch checking is paused while we raise funding. #SadFace
https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ]
Hello Pasha Tatashin,
Commit 8e068a286aef ("kho: update FDT dynamically for subtree
addition/removal") from Nov 14, 2025 (linux-next), leads to the
following Smatch static checker warning:
kernel/liveupdate/kexec_handover.c:777 kho_add_subtree()
warn: return mixup? 'err' vs 'fdt_err'
kernel/liveupdate/kexec_handover.c
767 {
768 phys_addr_t phys = virt_to_phys(fdt);
769 void *root_fdt = kho_out.fdt;
770 int err = -ENOMEM;
771 int off, fdt_err;
772
773 guard(mutex)(&kho_out.lock);
774
775 fdt_err = fdt_open_into(root_fdt, root_fdt, PAGE_SIZE);
776 if (fdt_err < 0)
--> 777 return err;
Why return err (-ENOMEM) here instead of fdt_err?
778
779 off = fdt_add_subnode(root_fdt, 0, name);
780 if (off < 0) {
781 if (off == -FDT_ERR_EXISTS)
782 err = -EEXIST;
783 goto out_pack;
784 }
785
786 err = fdt_setprop(root_fdt, off, KHO_FDT_SUB_TREE_PROP_NAME,
787 &phys, sizeof(phys));
788 if (err < 0)
789 goto out_pack;
790
791 WARN_ON_ONCE(kho_debugfs_fdt_add(&kho_out.dbg, name, fdt, false));
792
793 out_pack:
794 fdt_pack(root_fdt);
795
796 return err;
797 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-03 5:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-03 5:16 [bug report] kho: update FDT dynamically for subtree addition/removal Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox