Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4afaee15 authored by Christopher Brannon's avatar Christopher Brannon Committed by Greg Kroah-Hartman
Browse files

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: default avatarChristopher Brannon <chris@the-brannons.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ebadb730
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -2268,8 +2268,6 @@ static int __init speakup_init(void)
		set_mask_bits(0, i, 2);
		set_mask_bits(0, i, 2);


	set_key_info(key_defaults, key_buf);
	set_key_info(key_defaults, key_buf);
	if (quiet_boot)
		spk_shut_up |= 0x01;


	/* From here on out, initializations can fail. */
	/* From here on out, initializations can fail. */
	err = speakup_add_virtual_keyboard();
	err = speakup_add_virtual_keyboard();
@@ -2292,6 +2290,9 @@ static int __init speakup_init(void)
				goto error_kobjects;
				goto error_kobjects;
		}
		}


	if (quiet_boot)
		spk_shut_up |= 0x01;

	err = speakup_kobj_init();
	err = speakup_kobj_init();
	if (err)
	if (err)
		goto error_kobjects;
		goto error_kobjects;