[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210810063513.1757614-1-vee.khee.wong@linux.intel.com>
Date: Tue, 10 Aug 2021 14:35:13 +0800
From: Wong Vee Khee <vee.khee.wong@...ux.intel.com>
To: Vladimir Oltean <olteanv@...il.com>, Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Vladimir Oltean <vladimir.oltean@....com>
Subject: [PATCH net 1/1] net: dsa: sja1105: fix error handling on NULL returned by xpcs_create()
There is a possibility xpcs_create() returned a NULL and this is not
handled properly in the sja1105 driver.
Fixed this by using IS_ERR_ON_NULL() instead of IS_ERR().
Fixes: 3ad1d171548e ("net: dsa: sja1105: migrate to xpcs for SGMII")
Cc: Vladimir Olten <vladimir.oltean@....com>
Signed-off-by: Wong Vee Khee <vee.khee.wong@...ux.intel.com>
---
drivers/net/dsa/sja1105/sja1105_mdio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/sja1105/sja1105_mdio.c b/drivers/net/dsa/sja1105/sja1105_mdio.c
index 19aea8fb76f6..2c69a759ce6e 100644
--- a/drivers/net/dsa/sja1105/sja1105_mdio.c
+++ b/drivers/net/dsa/sja1105/sja1105_mdio.c
@@ -438,7 +438,7 @@ static int sja1105_mdiobus_pcs_register(struct sja1105_private *priv)
}
xpcs = xpcs_create(mdiodev, priv->phy_mode[port]);
- if (IS_ERR(xpcs)) {
+ if (IS_ERR_OR_NULL(xpcs)) {
rc = PTR_ERR(xpcs);
goto out_pcs_free;
}
--
2.25.1
Powered by blists - more mailing lists