summaryrefslogtreecommitdiff
path: root/drivers/net/netconsole.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-17 16:27:02 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-17 16:27:02 +0300
commitb4645e814de433b501c7e83de709a6e08e83388e (patch)
tree2b2f83b39462e435f834a87bc5a4e0360f55a517 /drivers/net/netconsole.c
parent243fdfb16a6a909e76cbd356a0368fdfd2109c53 (diff)
parent17365d66f1c6aa6bf4f4cb9842f5edeac027bcfb (diff)
downloadlinux-rolling-stable.tar.xz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 9c09293b5258..3e68f7a6e0ab 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -1118,8 +1118,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);