From a4326612ac4d5235d3ccf2d3ae40cc78b877ee38 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sat, 12 Sep 2020 17:45:44 -0400 Subject: [PATCH] log: syslog: Handle errors in net_init Since the previous patch, net_init now exposes some errors, so check for them. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- common/log_syslog.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/log_syslog.c b/common/log_syslog.c index 2ae703fed7..4eb09157bb 100644 --- a/common/log_syslog.c +++ b/common/log_syslog.c @@ -39,7 +39,9 @@ static int log_syslog_emit(struct log_device *ldev, struct log_rec *rec) char *log_hostname; /* Setup packet buffers */ - net_init(); + ret = net_init(); + if (ret) + return ret; /* Disable hardware and put it into the reset state */ eth_halt(); /* Set current device according to environment variables */ -- 2.39.5