diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-01-26 14:17:13 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-04-13 16:56:15 +0200 |
commit | 38a07fb8a943d7d338e6cc662a550d7c371e1131 (patch) | |
tree | 95ebb724a4240bcbd353912d34c8d5a6b4a8cd4d /net/netconsole.c | |
parent | d13f42dd3cdb762b9f0ff391e96988f5835b87c1 (diff) | |
download | barebox-38a07fb8a943d7d338e6cc662a550d7c371e1131.tar.gz barebox-38a07fb8a943d7d338e6cc662a550d7c371e1131.tar.xz |
netconsole: bail out if console_register fails
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net/netconsole.c')
-rw-r--r-- | net/netconsole.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/netconsole.c b/net/netconsole.c index 2ac3e64353..48f2b98437 100644 --- a/net/netconsole.c +++ b/net/netconsole.c @@ -174,6 +174,7 @@ static int netconsole_init(void) { struct nc_priv *priv; struct console_device *cdev; + int ret; priv = xzalloc(sizeof(*priv)); cdev = &priv->cdev; @@ -185,7 +186,12 @@ static int netconsole_init(void) priv->fifo = kfifo_alloc(1024); - console_register(cdev); + ret = console_register(cdev); + if (ret) { + printf("netconsole: registering failed with %s\n", strerror(-ret)); + kfree(priv); + return ret; + } dev_add_param(&cdev->class_dev, "ip", nc_remoteip_set, NULL, 0); dev_add_param(&cdev->class_dev, "port", nc_port_set, NULL, 0); |