diff mbox series

[3/3] log: syslog: Handle errors in net_init

Message ID 20200912214544.362594-4-seanga2@gmail.com
State Accepted
Delegated to: Tom Rini
Headers show
Series log: Fix segfault in sandbox when LOG_LEVEL_DEFAULT >= LOGL_DEBUG | expand

Commit Message

Sean Anderson Sept. 12, 2020, 9:45 p.m. UTC
Since the previous patch, net_init now exposes some errors, so check for
them.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
---

 common/log_syslog.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Simon Glass Sept. 17, 2020, 1:09 a.m. UTC | #1
On Sat, 12 Sep 2020 at 15:46, Sean Anderson <seanga2@gmail.com> wrote:
>
> Since the previous patch, net_init now exposes some errors, so check for
> them.
>
> Signed-off-by: Sean Anderson <seanga2@gmail.com>
> ---
>
>  common/log_syslog.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini Oct. 12, 2020, 1:15 a.m. UTC | #2
On Sat, Sep 12, 2020 at 05:45:44PM -0400, Sean Anderson wrote:

> 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>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/common/log_syslog.c b/common/log_syslog.c
index 149ff5af31..aaa0fcfa48 100644
--- a/common/log_syslog.c
+++ b/common/log_syslog.c
@@ -46,7 +46,9 @@  static int log_syslog_emit(struct log_device *ldev, struct log_rec *rec)
 	processing_msg = 1;
 
 	/* 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 */