diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-11-14 01:36:35 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-11-14 01:36:35 +0300 |
| commit | d6b9ce75e87c5f4bfbc0f7bba4f4f7cbf942f98a (patch) | |
| tree | 0b052e77f632b0cd080ffc5da3b5525e676f05f4 /drivers/net/netconsole.c | |
| parent | 8d422b8beb76bfc57f0fe4b03082f3823eccd150 (diff) | |
| parent | d0fcf70c680e4d1669fcb3a8632f41400b9a73c2 (diff) | |
| download | linux-d6b9ce75e87c5f4bfbc0f7bba4f4f7cbf942f98a.tar.xz | |
Merge tag 'stratix10_svc_fix_v6.18' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into char-misc-linus
Dinh writes:
firmware: stratix10-svc: fix saving contoller data for v6.18
- Fix the incorrect use of platform_set_drvdata and dev_set_drvdata
* tag 'stratix10_svc_fix_v6.18' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: (237 commits)
firmware: stratix10-svc: fix bug in saving controller data
Linux 6.18-rc4
objtool: Fix skip_alt_group() for non-alternative STAC/CLAC
kconfig/nconf: Initialize the default locale at startup
kconfig/mconf: Initialize the default locale at startup
x86/mm: Ensure clear_page() variants always have __kcfi_typeid_ symbols
PCI: Do not size non-existing prefetchable window
Revert "PCI: qcom: Remove custom ASPM enablement code"
bpf/arm64: Fix BPF_ST into arena memory
bpf: Make migrate_disable always inline to avoid partial inlining
null_blk: set dma alignment to logical block size
xfs: document another racy GC case in xfs_zoned_map_extent
xfs: prevent gc from picking the same zone twice
drm/ast: Clear preserved bits from register output value
s390: Disable ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP
drm/imx: parallel-display: add the bridge before attaching it
drm/imx: parallel-display: convert to devm_drm_bridge_alloc() API
blk-crypto: use BLK_STS_INVAL for alignment errors
regulator: bd718x7: Fix voltages scaled by resistor divider
x86/cpu: Add/fix core comments for {Panther,Nova} Lake
...
Diffstat (limited to 'drivers/net/netconsole.c')
| -rw-r--r-- | drivers/net/netconsole.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 194570443493..5d8d0214786c 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -886,8 +886,11 @@ static ssize_t userdatum_value_show(struct config_item *item, char *buf) static void update_userdata(struct netconsole_target *nt) { - int complete_idx = 0, child_count = 0; struct list_head *entry; + int child_count = 0; + unsigned long flags; + + spin_lock_irqsave(&target_list_lock, flags); /* Clear the current string in case the last userdatum was deleted */ nt->userdata_length = 0; @@ -897,8 +900,11 @@ static void update_userdata(struct netconsole_target *nt) struct userdatum *udm_item; struct config_item *item; - if (WARN_ON_ONCE(child_count >= MAX_EXTRADATA_ITEMS)) - break; + if (child_count >= MAX_EXTRADATA_ITEMS) { + spin_unlock_irqrestore(&target_list_lock, flags); + WARN_ON_ONCE(1); + return; + } child_count++; item = container_of(entry, struct config_item, ci_entry); @@ -912,12 +918,11 @@ static void update_userdata(struct netconsole_target *nt) * one entry length (1/MAX_EXTRADATA_ITEMS long), entry count is * checked to not exceed MAX items with child_count above */ - complete_idx += scnprintf(&nt->extradata_complete[complete_idx], - MAX_EXTRADATA_ENTRY_LEN, " %s=%s\n", - item->ci_name, udm_item->value); + nt->userdata_length += scnprintf(&nt->extradata_complete[nt->userdata_length], + MAX_EXTRADATA_ENTRY_LEN, " %s=%s\n", + item->ci_name, udm_item->value); } - nt->userdata_length = strnlen(nt->extradata_complete, - sizeof(nt->extradata_complete)); + spin_unlock_irqrestore(&target_list_lock, flags); } static ssize_t userdatum_value_store(struct config_item *item, const char *buf, |
