commit | 767ce42f8f9ebe5e37d5179121f23482606919b2 | [log] [tgz] |
---|---|---|
author | developer <developer@mediatek.com> | Thu Jul 25 21:50:05 2024 +0800 |
committer | developer <developer@mediatek.com> | Fri Jul 26 10:18:54 2024 +0800 |
tree | 654c627cb3a2d2ca216984a22d19ae80cc32d856 | |
parent | f2fbad60d1344c173a925777e5bc34ff79bdb45c [diff] |
[][kernel][common][eth][Refactor phylink pcs_enable and pcs_disable methods] [Description] Refactor phylink pcs_enable and pcs_disable methods. In the scenario where 'pcs' is not present, the temporary memory 'pcs' might remain uninitialized. However, if pl->pcs is not a NULL pointer, it will cause the CPU to unexpectedly execute pcs_enable, leading to the kernel dereferencing a non-NULL pointer. Without this patch, the kernel might encounter a panic issue when calling the pcs_enable function. [Release-log] N/A Change-Id: I454c1e5cf15ce5ac00f08c73abfae4f1d9e47f47 Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/9406030
diff --git a/21.02/files/target/linux/mediatek/patches-5.4/999-1716-v6.6-net-phy-add-phylink-pcs_enable-and-pcs_disable.patch b/21.02/files/target/linux/mediatek/patches-5.4/999-1716-v6.6-net-phy-add-phylink-pcs_enable-and-pcs_disable.patch index 29306fd..a3f7134 100644 --- a/21.02/files/target/linux/mediatek/patches-5.4/999-1716-v6.6-net-phy-add-phylink-pcs_enable-and-pcs_disable.patch +++ b/21.02/files/target/linux/mediatek/patches-5.4/999-1716-v6.6-net-phy-add-phylink-pcs_enable-and-pcs_disable.patch
@@ -38,7 +38,7 @@ - if (pcs_changed) + if (pcs_changed) { + if (pl->pcs && pl->pcs->ops->pcs_disable) -+ pcs->ops->pcs_disable(pl->pcs); ++ pl->pcs->ops->pcs_disable(pl->pcs); + pl->pcs = pcs; + } @@ -47,7 +47,7 @@ + if (pl->pcs_state == PCS_STATE_STARTING || pcs_changed) { + if (pl->pcs && pl->pcs->ops->pcs_enable) -+ err = pcs->ops->pcs_enable(pl->pcs); ++ err = pl->pcs->ops->pcs_enable(pl->pcs); + } + if (pl->pcs) {