mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
xtensa: ISS: don't allocate memory in platform_setup
commit ef439d49e0 upstream.
Memory allocator is not initialized at that point yet, use static array
instead.
Cc: stable@vger.kernel.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f63dbd23e8
commit
b205f931b0
@@ -78,23 +78,28 @@ static struct notifier_block iss_panic_block = {
|
|||||||
|
|
||||||
void __init platform_setup(char **p_cmdline)
|
void __init platform_setup(char **p_cmdline)
|
||||||
{
|
{
|
||||||
|
static void *argv[COMMAND_LINE_SIZE / sizeof(void *)] __initdata;
|
||||||
|
static char cmdline[COMMAND_LINE_SIZE] __initdata;
|
||||||
int argc = simc_argc();
|
int argc = simc_argc();
|
||||||
int argv_size = simc_argv_size();
|
int argv_size = simc_argv_size();
|
||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
void **argv = alloc_bootmem(argv_size);
|
if (argv_size > sizeof(argv)) {
|
||||||
char *cmdline = alloc_bootmem(argv_size);
|
pr_err("%s: command line too long: argv_size = %d\n",
|
||||||
int i;
|
__func__, argv_size);
|
||||||
|
} else {
|
||||||
|
int i;
|
||||||
|
|
||||||
cmdline[0] = 0;
|
cmdline[0] = 0;
|
||||||
simc_argv((void *)argv);
|
simc_argv((void *)argv);
|
||||||
|
|
||||||
for (i = 1; i < argc; ++i) {
|
for (i = 1; i < argc; ++i) {
|
||||||
if (i > 1)
|
if (i > 1)
|
||||||
strcat(cmdline, " ");
|
strcat(cmdline, " ");
|
||||||
strcat(cmdline, argv[i]);
|
strcat(cmdline, argv[i]);
|
||||||
|
}
|
||||||
|
*p_cmdline = cmdline;
|
||||||
}
|
}
|
||||||
*p_cmdline = cmdline;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block);
|
atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block);
|
||||||
|
|||||||
Reference in New Issue
Block a user