Skip to content

Commit

Permalink
sparc32: off by ones in BUG_ON()
Browse files Browse the repository at this point in the history
Smatch complains that these tests are off by one, which is true but not
life threatening.

	arch/sparc/kernel/irq_32.c:169 irq_link()
	error: buffer overflow 'irq_map' 384 <= 384

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Jul 28, 2016
1 parent 4f6deb8 commit fa16082
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/sparc/kernel/irq_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void irq_link(unsigned int irq)

p = &irq_table[irq];
pil = p->pil;
BUG_ON(pil > SUN4D_MAX_IRQ);
BUG_ON(pil >= SUN4D_MAX_IRQ);
p->next = irq_map[pil];
irq_map[pil] = p;

Expand All @@ -182,7 +182,7 @@ void irq_unlink(unsigned int irq)
spin_lock_irqsave(&irq_map_lock, flags);

p = &irq_table[irq];
BUG_ON(p->pil > SUN4D_MAX_IRQ);
BUG_ON(p->pil >= SUN4D_MAX_IRQ);
pnext = &irq_map[p->pil];
while (*pnext != p)
pnext = &(*pnext)->next;
Expand Down

0 comments on commit fa16082

Please sign in to comment.