diff options
| author | Christian Marangi <ansuelsmth@gmail.com> | 2026-08-17 23:30:03 +0200 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-08-20 14:07:43 -0700 |
| commit | f2849b1fd059ec9b3281b771e6ac5aad9feee851 (patch) | |
| tree | 6a9b4d76e911a438bdbfc93e89f0f953bfa2862e /tools/perf/scripts/python | |
| parent | 52ffb39e710db4b08cb0434741b96a9baf1a1934 (diff) | |
| download | linux-f2849b1fd059ec9b3281b771e6ac5aad9feee851.tar.gz linux-f2849b1fd059ec9b3281b771e6ac5aad9feee851.zip | |
net: phylink: correctly validate returned PCS in phylink_inband_caps
In phylink_inband_caps(), the PCS returned by mac_select_pcs is only
checked if NULL but mac_select_pcs can also return an error pointer.
This can cause a kernel panic as phylink_pcs_inband_caps() only checks
if passed PCS is not NULL and directly dereference ops from the phylink_pcs
struct.
Use the IS_ERR_OR_NULL macro to address both case where the returned
PCS can be NULL or an error pointer and prevent a kernel panic.
Cc: stable@vger.kernel.org
Fixes: df874f9e52c3 ("net: phylink: add pcs_inband_caps() method")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://patch.msgid.link/20260817213009.13924-1-ansuelsmth@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
