All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: icplus: Call phy_restore_page() when phy_select_page() fails
@ 2021-02-17  6:17 Dan Carpenter
  2021-02-17  7:52 ` Michael Walle
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Dan Carpenter @ 2021-02-17  6:17 UTC (permalink / raw)
  To: Andrew Lunn, Michael Walle
  Cc: Heiner Kallweit, Russell King, David S. Miller, Jakub Kicinski,
	netdev, kernel-janitors

Smatch warns that there is a locking issue in this function:

drivers/net/phy/icplus.c:273 ip101a_g_config_intr_pin()
warn: inconsistent returns '&phydev->mdio.bus->mdio_lock'.
  Locked on  : 242
  Unlocked on: 273

It turns out that the comments in phy_select_page() say we have to call
phy_restore_page() even if the call to phy_select_page() fails.

Fixes: f9bc51e6cce2 ("net: phy: icplus: fix paged register access")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/phy/icplus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
index 4e15d4d02488..015b7b5aa776 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -239,7 +239,7 @@ static int ip101a_g_config_intr_pin(struct phy_device *phydev)
 
 	oldpage = phy_select_page(phydev, IP101G_DEFAULT_PAGE);
 	if (oldpage < 0)
-		return oldpage;
+		goto out;
 
 	/* configure the RXER/INTR_32 pin of the 32-pin IP101GR if needed: */
 	switch (priv->sel_intr32) {
-- 
2.30.0


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

end of thread, other threads:[~2021-02-17 21:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-17  6:17 [PATCH net-next] net: phy: icplus: Call phy_restore_page() when phy_select_page() fails Dan Carpenter
2021-02-17  7:52 ` Michael Walle
2021-02-17 10:04 ` Russell King - ARM Linux admin
2021-02-17 10:12   ` Michael Walle
2021-02-17 10:21     ` Russell King - ARM Linux admin
2021-02-17 14:28 ` Dan Carpenter
2021-02-17 15:06   ` Russell King - ARM Linux admin
2021-02-17 15:33     ` Russell King - ARM Linux admin
2021-02-17 17:06       ` Andrew Lunn
2021-02-17 21:24         ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.