Re: [PATCH] xen/manage: unwind partial shutdown watcher setup on error

From: kernel test robot

Date: Tue Apr 21 2026 - 07:09:08 EST


Hi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on v7.0]
[cannot apply to xen-tip/linux-next linus/master next-20260420]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/zhaoguohan-kylinos-cn/xen-manage-unwind-partial-shutdown-watcher-setup-on-error/20260416-185003
base: v7.0
patch link: https://lore.kernel.org/r/20260407022443.12971-1-zhaoguohan%40kylinos.cn
patch subject: [PATCH] xen/manage: unwind partial shutdown watcher setup on error
config: arm64-randconfig-002-20260421 (https://download.01.org/0day-ci/archive/20260421/202604211801.rqptlYaS-lkp@xxxxxxxxx/config)
compiler: aarch64-linux-gcc (GCC) 13.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260421/202604211801.rqptlYaS-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604211801.rqptlYaS-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

drivers/xen/manage.c: In function 'setup_shutdown_watcher':
>> drivers/xen/manage.c:380:1: warning: label 'err_unregister_shutdown' defined but not used [-Wunused-label]
380 | err_unregister_shutdown:
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/xen/manage.c: In function 'shutdown_event':
drivers/xen/manage.c:357:60: warning: '%s' directive output may be truncated writing up to 71 bytes into a region of size 12 [-Wformat-truncation=]
357 | snprintf(node, FEATURE_PATH_SIZE, "feature-%s",
| ^~
In function 'setup_shutdown_watcher',
inlined from 'shutdown_event' at drivers/xen/manage.c:389:2:
drivers/xen/manage.c:357:17: note: 'snprintf' output between 9 and 80 bytes into a destination of size 20
357 | snprintf(node, FEATURE_PATH_SIZE, "feature-%s",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
358 | shutdown_handlers[idx].command);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/err_unregister_shutdown +380 drivers/xen/manage.c

353
354 for (idx = 0; idx < ARRAY_SIZE(shutdown_handlers); idx++) {
355 if (!shutdown_handlers[idx].flag)
356 continue;
357 snprintf(node, FEATURE_PATH_SIZE, "feature-%s",
358 shutdown_handlers[idx].command);
359 err = xenbus_printf(XBT_NIL, "control", node, "%u", 1);
360 if (err) {
361 pr_err("%s: Error %d writing %s\n", __func__,
362 err, node);
363 goto err_remove_features;
364 }
365 }
366
367 return 0;
368
369 err_remove_features:
370 while (--idx >= 0) {
371 if (!shutdown_handlers[idx].flag)
372 continue;
373 snprintf(node, FEATURE_PATH_SIZE, "feature-%s",
374 shutdown_handlers[idx].command);
375 xenbus_rm(XBT_NIL, "control", node);
376 }
377 #ifdef CONFIG_MAGIC_SYSRQ
378 unregister_xenbus_watch(&sysrq_watch);
379 #endif
> 380 err_unregister_shutdown:
381 unregister_xenbus_watch(&shutdown_watch);
382 return err;
383 }
384

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki