Re: [PATCH] net: prestera: avoid overreading a short firmware tail

From: kernel test robot

Date: Wed Sep 02 2026 - 09:40:20 EST


Hi Pengpeng,

kernel test robot noticed the following build errors:

[auto build test ERROR on 08dbfad3f5040f5bdb6c529da20d6d4e81fefd72]

url: https://github.com/intel-lab-lkp/linux/commits/Pengpeng-Hou/net-prestera-avoid-overreading-a-short-firmware-tail/20260830-222403
base: 08dbfad3f5040f5bdb6c529da20d6d4e81fefd72
patch link: https://lore.kernel.org/r/20260830142404.37663-1-pengpeng%40iscas.ac.cn
patch subject: [PATCH] net: prestera: avoid overreading a short firmware tail
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20260902/202609022030.0pnwZKgS-lkp@xxxxxxxxx/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260902/202609022030.0pnwZKgS-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/202609022030.0pnwZKgS-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> drivers/net/ethernet/marvell/prestera/prestera_pci.c:603:18: error: call to undeclared function 'get_unaligned'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
603 | writel_relaxed(get_unaligned((u32 *)(buf + i)),
| ^
1 error generated.


vim +/get_unaligned +603 drivers/net/ethernet/marvell/prestera/prestera_pci.c

589
590 static int prestera_ldr_send(struct prestera_fw *fw, const u8 *buf, size_t len)
591 {
592 size_t write_len = ALIGN(len, sizeof(u32));
593 size_t i;
594 int err;
595
596 err = prestera_ldr_wait_buf(fw, write_len);
597 if (err) {
598 dev_err(fw->dev.dev, "failed wait for sending firmware\n");
599 return err;
600 }
601
602 for (i = 0; i + sizeof(u32) <= len; i += sizeof(u32)) {
> 603 writel_relaxed(get_unaligned((u32 *)(buf + i)),
604 prestera_ldr_wr_ptr(fw));
605 prestera_ldr_wr_idx_move(fw, 4);
606 }
607 if (i < len) {
608 u32 last = 0;
609
610 memcpy(&last, buf + i, len - i);
611 writel_relaxed(last, prestera_ldr_wr_ptr(fw));
612 prestera_ldr_wr_idx_move(fw, 4);
613 }
614
615 prestera_ldr_wr_idx_commit(fw);
616 return 0;
617 }
618

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