summaryrefslogtreecommitdiffstats
path: root/common/log_syslog.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-09-14 10:01:00 +0200
committerSimon Glass <sjg@chromium.org>2020-09-22 12:54:13 -0600
commite5b35f706d13c8c0fffcf7b2af9c6df4f4190c5d (patch)
treeea457a190f382e0a317c501fd0a360b5cdbbedc6 /common/log_syslog.c
parent01d89e3d12e07a1a1ee0f8528706441a84eee328 (diff)
downloadu-boot-e5b35f706d13c8c0fffcf7b2af9c6df4f4190c5d.tar.gz
u-boot-e5b35f706d13c8c0fffcf7b2af9c6df4f4190c5d.tar.xz
u-boot-e5b35f706d13c8c0fffcf7b2af9c6df4f4190c5d.zip
log: mute messages generated by log drivers
When a message is written by a log driver (e.g. via the network stack) this may result in the generation of further messages. We cannot allow these additional messages to be emitted as this might result in an infinite recursion. Up to now only the syslog driver was safeguarded. We should safeguard all log drivers instead. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/log_syslog.c')
-rw-r--r--common/log_syslog.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/common/log_syslog.c b/common/log_syslog.c
index 149ff5af31..2ae703fed7 100644
--- a/common/log_syslog.c
+++ b/common/log_syslog.c
@@ -35,16 +35,9 @@ static int log_syslog_emit(struct log_device *ldev, struct log_rec *rec)
char *log_msg;
int eth_hdr_size;
struct in_addr bcast_ip;
- static int processing_msg;
unsigned int log_level;
char *log_hostname;
- /* Fend off messages from the network stack while writing a message */
- if (processing_msg)
- return 0;
-
- processing_msg = 1;
-
/* Setup packet buffers */
net_init();
/* Disable hardware and put it into the reset state */
@@ -108,7 +101,6 @@ static int log_syslog_emit(struct log_device *ldev, struct log_rec *rec)
net_send_packet((uchar *)msg, ptr - msg);
out:
- processing_msg = 0;
return ret;
}