aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netconsole.c
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2024-10-03 17:05:55 +0000
committerJakub Kicinski <[email protected]>2024-10-10 20:13:33 +0000
commit9c0fc36ec493d20599cf088d21b6bddcdc184242 (patch)
tree79d8fb91469d59cc1dd0a55477778f0a1167de8f /drivers/net/netconsole.c
parentnet/smc: Address spelling errors (diff)
parentMerge tag 'net-6.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/net... (diff)
downloadkernel-9c0fc36ec493d20599cf088d21b6bddcdc184242.tar.gz
kernel-9c0fc36ec493d20599cf088d21b6bddcdc184242.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR (net-6.12-rc3). No conflicts and no adjacent changes. Signed-off-by: Jakub Kicinski <[email protected]>
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);