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

Pratyush Yadav
2026-03-13T12:10:20Z

On Sat, Feb 28 2026, Dan Carpenter wrote:

> [ 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.

Seems like a legit complaint.

I suppose just print err directly in the next revision?

>
> --> 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

--
Regards,
Pratyush Yadav