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

Andy Shevchenko posted 2 patches 9 months ago
drivers/net/usb/ax88172a.c | 9 ++++++---
include/linux/phy.h        | 2 +-
2 files changed, 7 insertions(+), 4 deletions(-)
[PATCH net v2 0/2] net: phy: Fix potential string cut when using PHY_ID_FMT
Posted by Andy Shevchenko 9 months ago
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(-)

-- 
2.47.2