net: phy: realtek: net: Fix less than zero comparison of a u16
mainline inclusion from mainline-v5.14-rc1 commit f25247d8 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4H7E6 CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f25247d88708 ---------------------------------------------------------------------- The comparisons of the u16 values priv->phycr1 and priv->phycr2 to less than zero always false because they are unsigned. Fix this by using an int for the assignment and less than zero check. Addresses-Coverity: ("Unsigned compared against 0") Fixes: 0a4355c2 ("net: phy: realtek: add dt property to disable CLKOUT clock") Fixes: d90db36a ("net: phy: realtek: add dt property to enable ALDPS mode") Signed-off-by: NColin Ian King <colin.king@canonical.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net> Reviewed-by: NYongxin Li <liyongxin1@huawei.com> Signed-off-by: NJunxin Chen <chenjunxin1@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录