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 <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Sean Anderson 2020-09-12 17:45:44 -04:00 committed by Tom Rini
parent c3f0278e29
commit a4326612ac

View File

@ -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 */