net: phy: Fix truncation of large IRQ numbers in phy_attached_print()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 21 Sep 2017 11:27:02 +0000 (13:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Sep 2017 03:35:17 +0000 (20:35 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy_device.c

index 8cf0c5901f95870fc613edba0289594a5d40640a..67f25ac29025c53903cc724fac62efdd94828510 100644 (file)
@@ -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: