* [jcmvbkbc-xtensa:pr/26 1/1] drivers/net/netdevsim/fib.c:1506:24: error: incompatible pointer types initializing 'struct nsim_fib_data *' with an expression of type 'bool (*)(struct work_struct *)' (aka '_Bool (*)(struct work_struct *)')
@ 2025-12-20 19:16 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-12-20 19:16 UTC (permalink / raw)
To: pr-hung; +Cc: llvm, oe-kbuild-all
tree: https://github.com/jcmvbkbc/linux-xtensa pr/26
head: 0c125b4fcef40ea2c876496f0e3b9b6e74dcebde
commit: 0c125b4fcef40ea2c876496f0e3b9b6e74dcebde [1/1] Fix potential vulnerability in cloned code (drivers/net/netdevsim/fib.c)
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20251221/202512210327.HRXViKjl-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251221/202512210327.HRXViKjl-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512210327.HRXViKjl-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/net/netdevsim/fib.c:58:21: error: duplicate member 'fib_flush_work'
58 | struct work_struct fib_flush_work;
| ^
drivers/net/netdevsim/fib.c:57:21: note: previous declaration is here
57 | struct work_struct fib_flush_work;
| ^
drivers/net/netdevsim/fib.c:1502:58: error: expected ';' after top level declarator
1502 | static void nsim_fib_flush_work(struct work_struct *work)
| ^
| ;
drivers/net/netdevsim/fib.c:1507:2: error: expected identifier
1507 | struct nsim_fib_data *data = container_of(work, struct nsim_fib_data,
| ^
drivers/net/netdevsim/fib.c:1507:2: error: expected identifier
drivers/net/netdevsim/fib.c:1509:9: error: use of undeclared identifier 'fib_flush_work'; did you mean 'flush_work'?
1509 | fib_flush_work);
| ^~~~~~~~~~~~~~
| flush_work
include/linux/container_of.h:24:36: note: expanded from macro 'container_of'
24 | ((type *)(__mptr - offsetof(type, member))); })
| ^
include/linux/stddef.h:16:57: note: expanded from macro 'offsetof'
16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
| ^
include/linux/workqueue.h:610:13: note: 'flush_work' declared here
610 | extern bool flush_work(struct work_struct *work);
| ^
drivers/net/netdevsim/fib.c:1506:31: error: expected ';' after expression
1506 | struct nsim_fib_data *data = container_of(work, struct nsim_fib_data,
| ^
include/linux/container_of.h:24:21: note: expanded from macro 'container_of'
24 | ((type *)(__mptr - offsetof(type, member))); })
| ^
include/linux/stddef.h:16:63: note: expanded from macro 'offsetof'
16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
| ^
drivers/net/netdevsim/fib.c:1506:31: error: expected expression
include/linux/container_of.h:24:21: note: expanded from macro 'container_of'
24 | ((type *)(__mptr - offsetof(type, member))); })
| ^
include/linux/stddef.h:16:63: note: expanded from macro 'offsetof'
16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
| ^
>> drivers/net/netdevsim/fib.c:1506:24: error: incompatible pointer types initializing 'struct nsim_fib_data *' with an expression of type 'bool (*)(struct work_struct *)' (aka '_Bool (*)(struct work_struct *)') [-Werror,-Wincompatible-pointer-types]
1506 | struct nsim_fib_data *data = container_of(work, struct nsim_fib_data,
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1507 | struct nsim_fib_data *data = container_of(work, struct nsim_fib_data,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1508 | fib_flush_work);
| ~~~~~~~~~~~~~~~~
1509 | fib_flush_work);
| ~~~~~~~~~~~~~~~
drivers/net/netdevsim/fib.c:1511:22: error: redefinition of 'fib_rt'
1511 | struct nsim_fib_rt *fib_rt, *fib_rt_tmp;
| ^
drivers/net/netdevsim/fib.c:1510:22: note: previous definition is here
1510 | struct nsim_fib_rt *fib_rt, *fib_rt_tmp;
| ^
drivers/net/netdevsim/fib.c:1511:31: error: redefinition of 'fib_rt_tmp'
1511 | struct nsim_fib_rt *fib_rt, *fib_rt_tmp;
| ^
drivers/net/netdevsim/fib.c:1510:31: note: previous definition is here
1510 | struct nsim_fib_rt *fib_rt, *fib_rt_tmp;
| ^
drivers/net/netdevsim/fib.c:1526:34: error: expected ')'
1526 | nsim_fib_rt_ht_params);
| ^
drivers/net/netdevsim/fib.c:1524:25: note: to match this '('
1524 | rhashtable_remove_fast(&data->fib_rt_ht, &fib_rt->ht_node,
| ^
drivers/net/netdevsim/fib.c:1527:33: error: extraneous ')' before ';'
1527 | nsim_fib_rt_ht_params);
| ^
drivers/net/netdevsim/fib.c:1509:9: warning: expression result unused [-Wunused-value]
1509 | fib_flush_work);
| ^~~~~~~~~~~~~~
include/linux/container_of.h:24:36: note: expanded from macro 'container_of'
24 | ((type *)(__mptr - offsetof(type, member))); })
| ^~~~~~
include/linux/stddef.h:16:57: note: expanded from macro 'offsetof'
16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
| ^~~~~~
drivers/net/netdevsim/fib.c:1527:12: warning: expression result unused [-Wunused-value]
1527 | nsim_fib_rt_ht_params);
| ^~~~~~~~~~~~~~~~~~~~~
2 warnings and 12 errors generated.
vim +1506 drivers/net/netdevsim/fib.c
0ae3eb7b461120 Amit Cohen 2021-02-01 1501
180a6a3ee60a7c Ido Schimmel 2022-07-28 1502 static void nsim_fib_flush_work(struct work_struct *work)
0c125b4fcef40e pr-hung 2025-12-18 1503 static void nsim_fib_flush_work(struct work_struct *work)
0c125b4fcef40e pr-hung 2025-12-18 1504 {
180a6a3ee60a7c Ido Schimmel 2022-07-28 1505 {
180a6a3ee60a7c Ido Schimmel 2022-07-28 @1506 struct nsim_fib_data *data = container_of(work, struct nsim_fib_data,
0c125b4fcef40e pr-hung 2025-12-18 1507 struct nsim_fib_data *data = container_of(work, struct nsim_fib_data,
0c125b4fcef40e pr-hung 2025-12-18 1508 fib_flush_work);
180a6a3ee60a7c Ido Schimmel 2022-07-28 1509 fib_flush_work);
180a6a3ee60a7c Ido Schimmel 2022-07-28 1510 struct nsim_fib_rt *fib_rt, *fib_rt_tmp;
0c125b4fcef40e pr-hung 2025-12-18 1511 struct nsim_fib_rt *fib_rt, *fib_rt_tmp;
180a6a3ee60a7c Ido Schimmel 2022-07-28 1512
0c125b4fcef40e pr-hung 2025-12-18 1513
0c125b4fcef40e pr-hung 2025-12-18 1514 /* Process pending work. */
180a6a3ee60a7c Ido Schimmel 2022-07-28 1515 /* Process pending work. */
180a6a3ee60a7c Ido Schimmel 2022-07-28 1516 flush_work(&data->fib_event_work);
0c125b4fcef40e pr-hung 2025-12-18 1517 flush_work(&data->fib_event_work);
180a6a3ee60a7c Ido Schimmel 2022-07-28 1518
0c125b4fcef40e pr-hung 2025-12-18 1519
0c125b4fcef40e pr-hung 2025-12-18 1520 mutex_lock(&data->fib_lock);
180a6a3ee60a7c Ido Schimmel 2022-07-28 1521 mutex_lock(&data->fib_lock);
180a6a3ee60a7c Ido Schimmel 2022-07-28 1522 list_for_each_entry_safe(fib_rt, fib_rt_tmp, &data->fib_rt_list, list) {
0c125b4fcef40e pr-hung 2025-12-18 1523 list_for_each_entry_safe(fib_rt, fib_rt_tmp, &data->fib_rt_list, list) {
0c125b4fcef40e pr-hung 2025-12-18 1524 rhashtable_remove_fast(&data->fib_rt_ht, &fib_rt->ht_node,
180a6a3ee60a7c Ido Schimmel 2022-07-28 1525 rhashtable_remove_fast(&data->fib_rt_ht, &fib_rt->ht_node,
180a6a3ee60a7c Ido Schimmel 2022-07-28 1526 nsim_fib_rt_ht_params);
0c125b4fcef40e pr-hung 2025-12-18 1527 nsim_fib_rt_ht_params);
180a6a3ee60a7c Ido Schimmel 2022-07-28 1528 nsim_fib_rt_free(fib_rt, data);
0c125b4fcef40e pr-hung 2025-12-18 1529 nsim_fib_rt_free(fib_rt, data);
0c125b4fcef40e pr-hung 2025-12-18 1530 }
180a6a3ee60a7c Ido Schimmel 2022-07-28 1531 }
180a6a3ee60a7c Ido Schimmel 2022-07-28 1532 mutex_unlock(&data->fib_lock);
0c125b4fcef40e pr-hung 2025-12-18 1533 mutex_unlock(&data->fib_lock);
0c125b4fcef40e pr-hung 2025-12-18 1534 }
180a6a3ee60a7c Ido Schimmel 2022-07-28 1535 }
180a6a3ee60a7c Ido Schimmel 2022-07-28 1536
:::::: The code at line 1506 was first introduced by commit
:::::: 180a6a3ee60a7cb69ed1232388460644f6a21f00 netdevsim: fib: Fix reference count leak on route deletion failure
:::::: TO: Ido Schimmel <idosch@nvidia.com>
:::::: CC: David S. Miller <davem@davemloft.net>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-12-20 19:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-20 19:16 [jcmvbkbc-xtensa:pr/26 1/1] drivers/net/netdevsim/fib.c:1506:24: error: incompatible pointer types initializing 'struct nsim_fib_data *' with an expression of type 'bool (*)(struct work_struct *)' (aka '_Bool (*)(struct work_struct *)') kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox