logging: Fix tracking of buffered messages

Algorithm was failing in case when overflow mode was enabled
but allocation of new message failed. It could happen if message
size exceeded buffer size. Losing track of buffered messages
can lead to logging processing freeze.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2022-01-19 14:45:41 +01:00 committed by Anas Nashif
commit 18165b1d49
4 changed files with 13 additions and 7 deletions

View file

@ -12,7 +12,7 @@ void z_log_msg2_finalize(struct log_msg2 *msg, const void *source,
const struct log_msg2_desc desc, const void *data)
{
if (!msg) {
z_log_dropped();
z_log_dropped(false);
return;
}