Message ID | 20241008094325.896208-1-leitao@debian.org (mailing list archive) |
---|---|
State | Accepted |
Commit | d94785bb46b6167382b1de3290eccc91fa98df53 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net: netconsole: fix wrong warning | expand |
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski <kuba@kernel.org>: On Tue, 8 Oct 2024 02:43:24 -0700 you wrote: > A warning is triggered when there is insufficient space in the buffer > for userdata. However, this is not an issue since userdata will be sent > in the next iteration. > > Current warning message: > > > [...] Here is the summary with links: - [net] net: netconsole: fix wrong warning https://git.kernel.org/netdev/net/c/d94785bb46b6 You are awesome, thank you!
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);