Re: [PATCH net] net: dsa: mv88e6xxx: Fix PCS link check on CMODE read error

Vladimir Oltean <[email protected]>
Newsgroups gmane.linux.network,gmane.linux.kernel
Message-ID <20260813185312.ikljy4rqx6r2e7ci@skbuf>
On Thu, Aug 13, 2026 at 11:31:31PM +0800, Ruoyu Wang wrote:
> mv88e6352_pcs_link_check() ignores errors returned by
> port_get_cmode(). If the port status register read fails,
> mv88e6352_port_get_cmode() returns without setting cmode. The link check
> then compares an uninitialized value and may incorrectly treat the PCS
> as active.
> 
> Save the return value and fail the link check after releasing the
> register lock. marvell_c22_pcs_get_state() initializes the reported link
> state to down before calling the check, so a read failure is handled
> safely until a later poll succeeds.
> 
> This issue was found by a static analysis checker and confirmed by manual
> source review.
> 
> Fixes: 85764555442f ("net: dsa: mv88e6xxx: convert 88e6352 to phylink_pcs")
> Signed-off-by: Ruoyu Wang <[email protected]>
> ---

Reviewed-by: Vladimir Oltean <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.