Skip to content

Commit

Permalink
Staging: speakup: Don't try to access an unallocated struct.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christopher Brannon authored and Greg Kroah-Hartman committed Nov 27, 2011
1 parent ebadb73 commit 4afaee1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/staging/speakup/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand Down

0 comments on commit 4afaee1

Please sign in to comment.