summaryrefslogtreecommitdiff
path: root/drivers/staging/speakup/main.c
diff options
context:
space:
mode:
authorChristopher Brannon <chris@the-brannons.com>2011-11-22 13:46:23 -0600
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-26 18:13:55 -0800
commit4afaee1561e207683dbb886b30a842ffcc22e366 (patch)
tree0b0d8e8a1292476f03ff87ff226db3f5911ee013 /drivers/staging/speakup/main.c
parentebadb730435b74483daedcd59d664a2dccbe3903 (diff)
Staging: speakup: Don't try to access an unallocated struct.
In speakup_init, we have the following: if (quiet_boot) spk_shut_up |= 0x01; And in spk_types.h: This patch moves the statement in speakup_init so that speakup_console[vc->vc_num] is guaranteed to be allocated when it executes. Signed-off-by: Christopher Brannon <chris@the-brannons.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/speakup/main.c')
-rw-r--r--drivers/staging/speakup/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index 8be560458977..c7b03f0ef2dd 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -2268,8 +2268,6 @@ static int __init speakup_init(void)
set_mask_bits(0, i, 2);
set_key_info(key_defaults, key_buf);
- if (quiet_boot)
- spk_shut_up |= 0x01;
/* From here on out, initializations can fail. */
err = speakup_add_virtual_keyboard();
@@ -2292,6 +2290,9 @@ static int __init speakup_init(void)
goto error_kobjects;
}
+ if (quiet_boot)
+ spk_shut_up |= 0x01;
+
err = speakup_kobj_init();
if (err)
goto error_kobjects;