netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fjes: Add missing iounmap in fjes_hw_init()
@ 2025-12-10  2:32 Haoxiang Li
  2025-12-10  9:58 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Haoxiang Li @ 2025-12-10  2:32 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, lihaoxiang,
	izumi.taku
  Cc: netdev, linux-kernel, stable

In error paths, add fjes_hw_iounmap() to release the
resource acquired by fjes_hw_iomap().

Fixes: 8cdc3f6c5d22 ("fjes: Hardware initialization routine")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
---
 drivers/net/fjes/fjes_hw.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fjes/fjes_hw.c b/drivers/net/fjes/fjes_hw.c
index b9b5554ea862..a2e89ffa6f70 100644
--- a/drivers/net/fjes/fjes_hw.c
+++ b/drivers/net/fjes/fjes_hw.c
@@ -333,8 +333,10 @@ int fjes_hw_init(struct fjes_hw *hw)
 		return -EIO;
 
 	ret = fjes_hw_reset(hw);
-	if (ret)
+	if (ret) {
+		fjes_hw_iounmap(hw);
 		return ret;
+	}
 
 	fjes_hw_set_irqmask(hw, REG_ICTL_MASK_ALL, true);
 
@@ -347,8 +349,10 @@ int fjes_hw_init(struct fjes_hw *hw)
 	hw->max_epid = fjes_hw_get_max_epid(hw);
 	hw->my_epid = fjes_hw_get_my_epid(hw);
 
-	if ((hw->max_epid == 0) || (hw->my_epid >= hw->max_epid))
+	if ((hw->max_epid == 0) || (hw->my_epid >= hw->max_epid)) {
+		fjes_hw_iounmap(hw);
 		return -ENXIO;
+	}
 
 	ret = fjes_hw_setup(hw);
 
-- 
2.25.1


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

end of thread, other threads:[~2025-12-10  9:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-10  2:32 [PATCH] fjes: Add missing iounmap in fjes_hw_init() Haoxiang Li
2025-12-10  9:58 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).