Skip to content

Commit d3c2a69

Browse files
committed
Merge tag 'samsung-soc-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/soc
Samsung mach/soc changes for v5.16 A minor fix for theoretical issue when handling IRQ setup code errors in S3C24xx and a cleanup for S3C64xx. * tag 'samsung-soc-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: s3c: Use strscpy to replace strlcpy ARM: s3c: irq-s3c24xx: Fix return value check for s3c24xx_init_intc() Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 095ecaa + aa51947 commit d3c2a69

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

arch/arm/mach-s3c/irq-s3c24xx.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,25 @@ static inline int s3c24xx_handle_intc(struct s3c_irq_intc *intc,
361361
static asmlinkage void __exception_irq_entry s3c24xx_handle_irq(struct pt_regs *regs)
362362
{
363363
do {
364-
if (likely(s3c_intc[0]))
365-
if (s3c24xx_handle_intc(s3c_intc[0], regs, 0))
366-
continue;
364+
/*
365+
* For platform based machines, neither ERR nor NULL can happen here.
366+
* The s3c24xx_handle_irq() will be set as IRQ handler iff this succeeds:
367+
*
368+
* s3c_intc[0] = s3c24xx_init_intc()
369+
*
370+
* If this fails, the next calls to s3c24xx_init_intc() won't be executed.
371+
*
372+
* For DT machine, s3c_init_intc_of() could set the IRQ handler without
373+
* setting s3c_intc[0] only if it was called with num_ctrl=0. There is no
374+
* such code path, so again the s3c_intc[0] will have a valid pointer if
375+
* set_handle_irq() is called.
376+
*
377+
* Therefore in s3c24xx_handle_irq(), the s3c_intc[0] is always something.
378+
*/
379+
if (s3c24xx_handle_intc(s3c_intc[0], regs, 0))
380+
continue;
367381

368-
if (s3c_intc[2])
382+
if (!IS_ERR_OR_NULL(s3c_intc[2]))
369383
if (s3c24xx_handle_intc(s3c_intc[2], regs, 64))
370384
continue;
371385

arch/arm/mach-s3c/mach-mini6410.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ static char mini6410_features_str[12] __initdata = "0";
262262
static int __init mini6410_features_setup(char *str)
263263
{
264264
if (str)
265-
strlcpy(mini6410_features_str, str,
265+
strscpy(mini6410_features_str, str,
266266
sizeof(mini6410_features_str));
267267
return 1;
268268
}

0 commit comments

Comments
 (0)