netconsole: bail out when no connection is opened
When no connection is opened we should not call into the networking stack. Otherwise it can happen that we delay further execution until the network stack detected a link (or timed out bringing the link up). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
88ffe72278
commit
33987e9600
|
@ -81,6 +81,9 @@ static int nc_getc(struct console_device *cdev)
|
|||
struct nc_priv, cdev);
|
||||
unsigned char c;
|
||||
|
||||
if (!priv->con)
|
||||
return 0;
|
||||
|
||||
while (!kfifo_len(priv->fifo))
|
||||
net_poll();
|
||||
|
||||
|
@ -94,6 +97,9 @@ static int nc_tstc(struct console_device *cdev)
|
|||
struct nc_priv *priv = container_of(cdev,
|
||||
struct nc_priv, cdev);
|
||||
|
||||
if (!priv->con)
|
||||
return 0;
|
||||
|
||||
if (priv->busy)
|
||||
return kfifo_len(priv->fifo) ? 1 : 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue