Skip to content

net: phy: Fix potential string cut when using PHY_ID_FMT

Andy Shevchenko linux-usb lkml netdev oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 9 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2net: phy: Fix formatting specifier to avoid potential string cutsinclude/linux/phy.h+1 -14 replies
2/2net: usb: asix: ax88772: Increase phy_name sizedrivers/net/usb/ax88172a.c+6 -35 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH net v2 0/2] net: phy: Fix potential string cut when using PHY_ID_FMT

The agreement and also PHY_MAX_ADDR limit suggests that the PHY id can't occupy more than 2 hex digits. In some cases GCC complains about potential string cut. Avoid that by limiting specifier to print only 2 hex digits (patch 1). With that, fix the ASIX driver that triggers GCC and use agreed + 3 in the size of the phy_name (patch 2).

In v2:
- added first patch
- added a conditional to the ASIX driver (Andrew)

Andy Shevchenko (2):
net: phy: Fix formatting specifier to avoid potential string cuts
net: usb: asix: ax88772: Increase phy_name size

 drivers/net/usb/ax88172a.c | 9 ++++++---
 include/linux/phy.h        | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)
Signature · 1 line
2.47.2