public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] include: phy: fix NULL pointer check in phy_write()
@ 2020-08-18  0:31 Thirupathaiah Annapureddy
  2020-08-18  6:07 ` Michal Simek
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Thirupathaiah Annapureddy @ 2020-08-18  0:31 UTC (permalink / raw)
  To: u-boot

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 <thiruan@linux.microsoft.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-17 13:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-18  0:31 [PATCH] include: phy: fix NULL pointer check in phy_write() Thirupathaiah Annapureddy
2020-08-18  6:07 ` Michal Simek
2020-09-15 14:23 ` Michal Simek
2020-09-15 15:00   ` Tom Rini
2020-09-17 13:54 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox