linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hvc_console: Don't access hvc_task if not initialised
@ 2011-03-24  7:29 Amit Shah
  2011-03-24 14:58 ` Milton Miller
  0 siblings, 1 reply; 11+ messages in thread
From: Amit Shah @ 2011-03-24  7:29 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Rusty Russell, linux-kernel, greg, Amit Shah, stable

hvc_open() can be called without having any backing device.  This
results in a call to hvc_kick() which calls wake_up_process on a NULL
pointer.  Ensure hvc is initialised by checking for a non-NULL hvc_task
before waking up the hvc thread.

This was found by an autotest run for virtio_console without having a
console backend.

CC: stable@kernel.org
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 drivers/tty/hvc/hvc_console.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
index e9cba13..b2cb5cc 100644
--- a/drivers/tty/hvc/hvc_console.c
+++ b/drivers/tty/hvc/hvc_console.c
@@ -286,6 +286,9 @@ EXPORT_SYMBOL_GPL(hvc_instantiate);
 /* Wake the sleeping khvcd */
 void hvc_kick(void)
 {
+	if (!hvc_task)
+		return;
+
 	hvc_kicked = 1;
 	wake_up_process(hvc_task);
 }
-- 
1.7.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-04-28  4:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-24  7:29 [PATCH] hvc_console: Don't access hvc_task if not initialised Amit Shah
2011-03-24 14:58 ` Milton Miller
2011-03-25  8:47   ` Amit Shah
2011-03-28 17:52     ` Milton Miller
2011-04-20 12:33       ` Amit Shah
2011-04-20 14:34         ` Greg KH
2011-04-20 17:06           ` Amit Shah
2011-04-27  5:01             ` Rusty Russell
2011-04-27  6:31               ` Amit Shah
2011-04-28  0:09                 ` Greg KH
2011-04-28  4:00                   ` Amit Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).