diff options
Diffstat (limited to 'drivers/char/hvc_vio.c')
-rw-r--r-- | drivers/char/hvc_vio.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c index f5212eb2b41d..9add81ceb440 100644 --- a/drivers/char/hvc_vio.c +++ b/drivers/char/hvc_vio.c | |||
@@ -31,10 +31,13 @@ | |||
31 | 31 | ||
32 | #include <linux/types.h> | 32 | #include <linux/types.h> |
33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
34 | |||
34 | #include <asm/hvconsole.h> | 35 | #include <asm/hvconsole.h> |
35 | #include <asm/vio.h> | 36 | #include <asm/vio.h> |
36 | #include <asm/prom.h> | 37 | #include <asm/prom.h> |
37 | 38 | ||
39 | #include "hvc_console.h" | ||
40 | |||
38 | char hvc_driver_name[] = "hvc_console"; | 41 | char hvc_driver_name[] = "hvc_console"; |
39 | 42 | ||
40 | static struct vio_device_id hvc_driver_table[] __devinitdata = { | 43 | static struct vio_device_id hvc_driver_table[] __devinitdata = { |
@@ -48,6 +51,14 @@ static int filtered_get_chars(uint32_t vtermno, char *buf, int count) | |||
48 | unsigned long got; | 51 | unsigned long got; |
49 | int i; | 52 | int i; |
50 | 53 | ||
54 | /* | ||
55 | * Vio firmware will read up to SIZE_VIO_GET_CHARS at its own discretion | ||
56 | * so we play safe and avoid the situation where got > count which could | ||
57 | * overload the flip buffer. | ||
58 | */ | ||
59 | if (count < SIZE_VIO_GET_CHARS) | ||
60 | return -EAGAIN; | ||
61 | |||
51 | got = hvc_get_chars(vtermno, buf, count); | 62 | got = hvc_get_chars(vtermno, buf, count); |
52 | 63 | ||
53 | /* | 64 | /* |