Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1736560 > unrolled thread
| Started by | Geert Uytterhoeven <geert+renesas@glider.be> |
|---|---|
| First post | 2017-09-21 13:30 +0200 |
| Last post | 2017-09-22 05:40 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] net: phy: Fix truncation of large IRQ numbers in phy_attached_print() Geert Uytterhoeven <geert+renesas@glider.be> - 2017-09-21 13:30 +0200
Re: [PATCH] net: phy: Fix truncation of large IRQ numbers in phy_attached_print() Andrew Lunn <andrew@lunn.ch> - 2017-09-21 17:50 +0200
Re: [PATCH] net: phy: Fix truncation of large IRQ numbers in phy_attached_print() David Miller <davem@davemloft.net> - 2017-09-22 05:40 +0200
| From | Geert Uytterhoeven <geert+renesas@glider.be> |
|---|---|
| Date | 2017-09-21 13:30 +0200 |
| Subject | [PATCH] net: phy: Fix truncation of large IRQ numbers in phy_attached_print() |
| Message-ID | <us7Q7-kv-35@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-09-21 17:50 +0200 |
| Subject | Re: [PATCH] net: phy: Fix truncation of large IRQ numbers in phy_attached_print() |
| Message-ID | <usbTI-2TP-29@gated-at.bofh.it> |
| In reply to | #1736560 |
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
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2017-09-22 05:40 +0200 |
| Subject | Re: [PATCH] net: phy: Fix truncation of large IRQ numbers in phy_attached_print() |
| Message-ID | <usmYO-16o-17@gated-at.bofh.it> |
| In reply to | #1736560 |
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.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web