[bug report] tests/liveupdate: add in-kernel liveupdate test

Dan Carpenter
2026-02-28T11:48:26Z

[ Smatch checking is paused while we raise funding. #SadFace
https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ]

Hello Pasha Tatashin,

Commit f653ff7af969 ("tests/liveupdate: add in-kernel liveupdate
test") from Dec 18, 2025 (linux-next), leads to the following Smatch
static checker warning:

lib/tests/liveupdate.c:130 liveupdate_test_register()
warn: passing zero to 'ERR_PTR'

lib/tests/liveupdate.c
112 void liveupdate_test_register(struct liveupdate_file_handler *fh)
113 {
114 int err, i;
115
116 liveupdate_test_init();
117
118 for (i = 0; i < TEST_NFLBS; i++) {
119 struct liveupdate_flb *flb = &test_flbs[i];
120
121 err = liveupdate_register_flb(fh, flb);
122 if (err) {
123 pr_err("Failed to register %s %pe\n",
124 flb->compatible, ERR_PTR(err));
125 }
126 }
127
128 err = liveupdate_register_flb(fh, &test_flbs[0]);
129 if (!err || err != -EEXIST) {
^^
|| vs && bug. This error messages will always be printed.

--> 130 pr_err("Failed: %s should be already registered, but got err: %pe\n",
131 test_flbs[0].compatible, ERR_PTR(err));
132 }
133
134 pr_info("Registered %d FLBs with file handler: [%s]\n",
135 TEST_NFLBS, fh->compatible);
136 }

regards,
dan carpenter