summaryrefslogtreecommitdiff
path: root/drivers/net/netconsole.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-11-08 12:13:48 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2024-11-08 12:13:48 -0500
commite3e0f9b7ae280f2f479f74ef7799f4108d0e7f77 (patch)
tree85a1717293b6536f51176b6daa6e87e5f8338a88 /drivers/net/netconsole.c
parent5cb1659f412041e4780f2e8ee49b2e03728a2ba6 (diff)
parent332fa4a802b16ccb727199da685294f85f9880cb (diff)
Merge tag 'kvm-riscv-6.13-1' of https://github.com/kvm-riscv/linux into HEAD
KVM/riscv changes for 6.13 - Accelerate KVM RISC-V when running as a guest - Perf support to collect KVM guest statistics from host side
Diffstat (limited to 'drivers/net/netconsole.c')
-rw-r--r--drivers/net/netconsole.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 01cf33fa7503..de20928f7402 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -1161,8 +1161,14 @@ static void send_ext_msg_udp(struct netconsole_target *nt, const char *msg,
this_chunk = min(userdata_len - sent_userdata,
MAX_PRINT_CHUNK - preceding_bytes);
- if (WARN_ON_ONCE(this_chunk <= 0))
+ if (WARN_ON_ONCE(this_chunk < 0))
+ /* this_chunk could be zero if all the previous
+ * message used all the buffer. This is not a
+ * problem, userdata will be sent in the next
+ * iteration
+ */
return;
+
memcpy(buf + this_header + this_offset,
userdata + sent_userdata,
this_chunk);