Skip to content

Commit e51c747

Browse files
leitaokuba-moo
authored andcommitted
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]>
1 parent 14ea4cd commit e51c747

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/netconsole.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ static void update_userdata(struct netconsole_target *nt)
730730
struct userdatum *udm_item;
731731
struct config_item *item;
732732

733-
if (child_count >= MAX_USERDATA_ITEMS)
733+
if (WARN_ON_ONCE(child_count >= MAX_USERDATA_ITEMS))
734734
break;
735735
child_count++;
736736

0 commit comments

Comments
 (0)