All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: phy: Fix truncation of large IRQ numbers in phy_attached_print()
@ 2017-09-21 11:27 Geert Uytterhoeven
  2017-09-21 15:40 ` Andrew Lunn
  2017-09-22  3:36 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2017-09-21 11:27 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, David S . Miller
  Cc: Romain Perier, netdev, linux-kernel, Geert Uytterhoeven

Given NR_IRQS is 2048 on sparc64, and even 32784 on alpha, 3 digits is
not enough to represent interrupt numbers on all architectures.  Hence
PHY interrupt numbers may be truncated during printing.

Increase the buffer size from 4 to 8 bytes to fix this.

Fixes: 5e369aefdce4818c ("net: stmmac: Delete dead code for MDIO registration")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/net/phy/phy_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 8cf0c5901f95870f..67f25ac29025c539 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -879,7 +879,7 @@ void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
 {
 	const char *drv_name = phydev->drv ? phydev->drv->name : "unbound";
 	char *irq_str;
-	char irq_num[4];
+	char irq_num[8];
 
 	switch(phydev->irq) {
 	case PHY_POLL:
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: phy: Fix truncation of large IRQ numbers in phy_attached_print()
  2017-09-21 11:27 [PATCH] net: phy: Fix truncation of large IRQ numbers in phy_attached_print() Geert Uytterhoeven
@ 2017-09-21 15:40 ` Andrew Lunn
  2017-09-22  3:36 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2017-09-21 15:40 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Florian Fainelli, David S . Miller, Romain Perier, netdev, linux-kernel

On Thu, Sep 21, 2017 at 01:27:02PM +0200, Geert Uytterhoeven wrote:
> Given NR_IRQS is 2048 on sparc64, and even 32784 on alpha, 3 digits is
> not enough to represent interrupt numbers on all architectures.  Hence
> PHY interrupt numbers may be truncated during printing.
> 
> Increase the buffer size from 4 to 8 bytes to fix this.
> 
> Fixes: 5e369aefdce4818c ("net: stmmac: Delete dead code for MDIO registration")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: phy: Fix truncation of large IRQ numbers in phy_attached_print()
  2017-09-21 11:27 [PATCH] net: phy: Fix truncation of large IRQ numbers in phy_attached_print() Geert Uytterhoeven
  2017-09-21 15:40 ` Andrew Lunn
@ 2017-09-22  3:36 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-09-22  3:36 UTC (permalink / raw)
  To: geert+renesas; +Cc: andrew, f.fainelli, romain.perier, netdev, linux-kernel

From: Geert Uytterhoeven <geert+renesas@glider.be>
Date: Thu, 21 Sep 2017 13:27:02 +0200

> Given NR_IRQS is 2048 on sparc64, and even 32784 on alpha, 3 digits is
> not enough to represent interrupt numbers on all architectures.  Hence
> PHY interrupt numbers may be truncated during printing.
> 
> Increase the buffer size from 4 to 8 bytes to fix this.
> 
> Fixes: 5e369aefdce4818c ("net: stmmac: Delete dead code for MDIO registration")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-22  3:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-21 11:27 [PATCH] net: phy: Fix truncation of large IRQ numbers in phy_attached_print() Geert Uytterhoeven
2017-09-21 15:40 ` Andrew Lunn
2017-09-22  3:36 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.