From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thirupathaiah Annapureddy Date: Mon, 17 Aug 2020 17:31:08 -0700 Subject: [PATCH] include: phy: fix NULL pointer check in phy_write() Message-ID: <20200818003108.30061-1-thiruan@linux.microsoft.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de phy_write() uses bus->write() instead of bus->read(). This means NULL pointer pre-check needs to happen on bus->write instead of bus->read. Signed-off-by: Thirupathaiah Annapureddy --- include/phy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/phy.h b/include/phy.h index 1dbbf65111..cbdb10d6fc 100644 --- a/include/phy.h +++ b/include/phy.h @@ -205,7 +205,7 @@ static inline int phy_write(struct phy_device *phydev, int devad, int regnum, { struct mii_dev *bus = phydev->bus; - if (!bus || !bus->read) { + if (!bus || !bus->write) { debug("%s: No bus configured\n", __func__); return -1; } -- 2.25.2