diff options
| author | Breno Leitao <[email protected]> | 2025-01-08 11:50:25 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-01-10 02:06:36 +0000 |
| commit | e51c7478d23bb484d414fc036cd1ff57afe31b67 (patch) | |
| tree | 7901857bae1cf8c24e83ea9bcf06c001eca8d35b /drivers/net/netconsole.c | |
| parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net (diff) | |
| download | kernel-e51c7478d23bb484d414fc036cd1ff57afe31b67.tar.gz kernel-e51c7478d23bb484d414fc036cd1ff57afe31b67.zip | |
netconsole: Warn if MAX_USERDATA_ITEMS limit is exceeded
netconsole configfs helpers doesn't allow the creation of more than
MAX_USERDATA_ITEMS items.
Add a warning when netconsole userdata update function attempts sees
more than MAX_USERDATA_ITEMS entries.
Replace silent ignore mechanism with WARN_ON_ONCE() to highlight
potential misuse during development and debugging.
Signed-off-by: Breno Leitao <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/netconsole.c')
| -rw-r--r-- | drivers/net/netconsole.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index f422a2f666ef..86ab4a42769a 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -730,7 +730,7 @@ static void update_userdata(struct netconsole_target *nt) struct userdatum *udm_item; struct config_item *item; - if (child_count >= MAX_USERDATA_ITEMS) + if (WARN_ON_ONCE(child_count >= MAX_USERDATA_ITEMS)) break; child_count++; |
