Skip to content

Commit

Permalink
bcma: fix buffer size caused crash in bcma_core_mips_print_irq()
Browse files Browse the repository at this point in the history
Used buffer wasn't big enough to hold whole strings. Example output of
this function is:
[    0.180892] bcma: bus0: core 0x0800, irq: 2(S)* 3  4  5  6  D  I
[    0.180948] bcma: bus0: core 0x0812, irq: 2(S)  3* 4  5  6  D  I
[    0.180998] bcma: bus0: core 0x082d, irq: 2(S)  3  4* 5  6  D  I
[    0.181046] bcma: bus0: core 0x082c, irq: 2(S)  3  4  5  6  D  I*
which means we need to store up to 24 chars.

Fixes: 758f7e0 ("bcma: Use bcma_debug and not pr_cont in MIPS driver")
Signed-off-by: Rafał Miłecki <[email protected]>
Cc: [email protected] # v4.15+
Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
Rafał Miłecki authored and Kalle Valo committed May 12, 2018
1 parent a8d7aa1 commit 361de09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/bcma/driver_mips.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static void bcma_core_mips_print_irq(struct bcma_device *dev, unsigned int irq)
{
int i;
static const char *irq_name[] = {"2(S)", "3", "4", "5", "6", "D", "I"};
char interrupts[20];
char interrupts[25];
char *ints = interrupts;

for (i = 0; i < ARRAY_SIZE(irq_name); i++)
Expand Down

0 comments on commit 361de09

Please sign in to comment.