log: syslog: Handle errors in net_init
authorSean Anderson <seanga2@gmail.com>
Sat, 12 Sep 2020 21:45:44 +0000 (17:45 -0400)
committerTom Rini <trini@konsulko.com>
Sat, 10 Oct 2020 20:50:12 +0000 (16:50 -0400)
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>
common/log_syslog.c

index 2ae703f..4eb0915 100644 (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 */