Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'for-5.17/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux

Pull more parisc architecture updates from Helge Deller:
"Fixes and enhancements:

- a memory leak fix in an error path in pdc_stable (Miaoqian Lin)

- two compiler warning fixes in the TOC code

- added autodetection for currently used console type (serial or
graphics) which inserts console=<type> if it's missing"

* tag 'for-5.17/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
parisc: pdc_stable: Fix memory leak in pdcs_register_pathentries
parisc: Fix missing prototype for 'toc_intr' warning in toc.c
parisc: Autodetect default output device and set console= kernel parameter
parisc: Use safer strscpy() in setup_cmdline()
parisc: Add visible flag to toc_stack variable

+19 -4
+1
arch/parisc/include/asm/processor.h
··· 289 289 290 290 extern int running_on_qemu; 291 291 292 + extern void __noreturn toc_intr(struct pt_regs *regs); 292 293 extern void toc_handler(void); 293 294 extern unsigned int toc_handler_size; 294 295 extern unsigned int toc_handler_csum;
+13 -2
arch/parisc/kernel/setup.c
··· 48 48 void __init setup_cmdline(char **cmdline_p) 49 49 { 50 50 extern unsigned int boot_args[]; 51 + char *p; 51 52 52 53 /* Collect stuff passed in from the boot loader */ 53 54 ··· 57 56 /* called from hpux boot loader */ 58 57 boot_command_line[0] = '\0'; 59 58 } else { 60 - strlcpy(boot_command_line, (char *)__va(boot_args[1]), 59 + strscpy(boot_command_line, (char *)__va(boot_args[1]), 61 60 COMMAND_LINE_SIZE); 61 + 62 + /* autodetect console type (if not done by palo yet) */ 63 + p = boot_command_line; 64 + if (!str_has_prefix(p, "console=") && !strstr(p, " console=")) { 65 + strlcat(p, " console=", COMMAND_LINE_SIZE); 66 + if (PAGE0->mem_cons.cl_class == CL_DUPLEX) 67 + strlcat(p, "ttyS0", COMMAND_LINE_SIZE); 68 + else 69 + strlcat(p, "tty0", COMMAND_LINE_SIZE); 70 + } 62 71 63 72 #ifdef CONFIG_BLK_DEV_INITRD 64 73 if (boot_args[2] != 0) /* did palo pass us a ramdisk? */ ··· 79 68 #endif 80 69 } 81 70 82 - strcpy(command_line, boot_command_line); 71 + strscpy(command_line, boot_command_line, COMMAND_LINE_SIZE); 83 72 *cmdline_p = command_line; 84 73 } 85 74
+2 -1
arch/parisc/kernel/toc.c
··· 10 10 #include <asm/pdc.h> 11 11 #include <asm/pdc_chassis.h> 12 12 #include <asm/ldcw.h> 13 + #include <asm/processor.h> 13 14 14 15 static unsigned int __aligned(16) toc_lock = 1; 15 - DEFINE_PER_CPU_PAGE_ALIGNED(char [16384], toc_stack); 16 + DEFINE_PER_CPU_PAGE_ALIGNED(char [16384], toc_stack) __visible; 16 17 17 18 static void toc20_to_pt_regs(struct pt_regs *regs, struct pdc_toc_pim_20 *toc) 18 19 {
+3 -1
drivers/parisc/pdc_stable.c
··· 980 980 entry->kobj.kset = paths_kset; 981 981 err = kobject_init_and_add(&entry->kobj, &ktype_pdcspath, NULL, 982 982 "%s", entry->name); 983 - if (err) 983 + if (err) { 984 + kobject_put(&entry->kobj); 984 985 return err; 986 + } 985 987 986 988 /* kobject is now registered */ 987 989 write_lock(&entry->rw_lock);