From: Dan Carpenter <dan.carpenter@linaro.org>
To: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: kexec@lists.infradead.org, linux-mm@kvack.org
Subject: [bug report] kho: update FDT dynamically for subtree addition/removal
Date: Tue, 3 Mar 2026 08:16:35 +0300 [thread overview]
Message-ID: <aaZus68Dao_6Ckwf@stanley.mountain> (raw)
[ 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
reply other threads:[~2026-03-03 5:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aaZus68Dao_6Ckwf@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=kexec@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=pasha.tatashin@soleen.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.