Skip to content

net: usb: asix: ax88772: Fix potential string cut

Andy Shevchenko linux-usb lkml netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest2 patches 4 repliesApplied 2/2

Patches in v3 All 2 applied

#Subject and filesSizeRepliesApplied
1/2net: phy: Introduce PHY_ID_SIZE — minimum size for PHY ID stringinclude/linux/phy.h+1 -04 repliesApplied
2/2net: usb: asix: ax88772: Increase phy_name sizedrivers/net/usb/ax88172a.c+8 -40 repliesApplied

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchRussell King (Oracle)
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net v3 0/2] net: usb: asix: ax88772: Fix potential string cut

The agreement and also PHY_MAX_ADDR limit suggest that the PHY address can't occupy more than two hex digits. In some cases GCC complains about potential string cut. In course of fixing this, introduce the PHY_ID_SIZE predefined constant to make it easier for the users to know the bare minimum for the buffer that holds PHY ID string (patch 1). With that, fix the ASIX driver that triggers GCC accordingly (patch 2).

In v3:
- dropped format specifier changes (Russell, LKP)
- added predefined constant for a minimum buffer size (Russell)
- updated error message to refer to the address and not ID string (Russell)
- changed type of phy_addr to u8, otherwise GCC can't cope with its range

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

Andy Shevchenko (2):
net: phy: Introduce PHY_ID_SIZE — minimum size for PHY ID string
net: usb: asix: ax88772: Increase phy_name size

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