netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] fjes: Add missing iounmap in fjes_hw_init()
@ 2025-12-11  7:37 Haoxiang Li
  2025-12-11  9:10 ` Markus Elfring
  2025-12-11 17:49 ` Simon Horman
  0 siblings, 2 replies; 4+ messages in thread
From: Haoxiang Li @ 2025-12-11  7:37 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, izumi.taku
  Cc: netdev, linux-kernel, Haoxiang Li, stable, Simon Horman

In error paths, add fjes_hw_iounmap() to release the
resource acquired by fjes_hw_iomap(). Add a goto label
to do so.

Fixes: 8cdc3f6c5d22 ("fjes: Hardware initialization routine")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Signed-off-by: Simon Horman <horms@kernel.org>
---
Changes in v2:
- Use an idiomatic goto to do the error hanlding.
- Thanks for pointing out the issues with the patch, Simon!
---
 drivers/net/fjes/fjes_hw.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/fjes/fjes_hw.c b/drivers/net/fjes/fjes_hw.c
index b9b5554ea862..5ad2673f213d 100644
--- a/drivers/net/fjes/fjes_hw.c
+++ b/drivers/net/fjes/fjes_hw.c
@@ -334,7 +334,7 @@ int fjes_hw_init(struct fjes_hw *hw)
 
 	ret = fjes_hw_reset(hw);
 	if (ret)
-		return ret;
+		goto err_iounmap;
 
 	fjes_hw_set_irqmask(hw, REG_ICTL_MASK_ALL, true);
 
@@ -347,8 +347,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))
-		return -ENXIO;
+	if ((hw->max_epid == 0) || (hw->my_epid >= hw->max_epid)) {
+		ret = -ENXIO;
+		goto err_iounmap;
+	}
 
 	ret = fjes_hw_setup(hw);
 
@@ -356,6 +358,10 @@ int fjes_hw_init(struct fjes_hw *hw)
 	hw->hw_info.trace_size = FJES_DEBUG_BUFFER_SIZE;
 
 	return ret;
+
+err_iounmap:
+	fjes_hw_iounmap(hw);
+	return ret;
 }
 
 void fjes_hw_exit(struct fjes_hw *hw)
-- 
2.25.1


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

* Re: [PATCH v2] fjes: Add missing iounmap in fjes_hw_init()
  2025-12-11  7:37 [PATCH v2] fjes: Add missing iounmap in fjes_hw_init() Haoxiang Li
@ 2025-12-11  9:10 ` Markus Elfring
  2025-12-11 10:49   ` Greg KH
  2025-12-11 17:49 ` Simon Horman
  1 sibling, 1 reply; 4+ messages in thread
From: Markus Elfring @ 2025-12-11  9:10 UTC (permalink / raw)
  To: Haoxiang Li, netdev, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Taku Izumi
  Cc: stable, LKML

> In error paths, add fjes_hw_iounmap() to release the
> resource acquired by fjes_hw_iomap(). Add a goto label
> to do so.

Under which circumstances would you get into the mood to take more desirable
word wrap preferences better into account?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.18#n658

Regards,
Markus

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

* Re: [PATCH v2] fjes: Add missing iounmap in fjes_hw_init()
  2025-12-11  9:10 ` Markus Elfring
@ 2025-12-11 10:49   ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2025-12-11 10:49 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Haoxiang Li, netdev, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Taku Izumi, stable,
	LKML

On Thu, Dec 11, 2025 at 10:10:37AM +0100, Markus Elfring wrote:
> > In error paths, add fjes_hw_iounmap() to release the
> > resource acquired by fjes_hw_iomap(). Add a goto label
> > to do so.
> 
> Under which circumstances would you get into the mood to take more desirable
> word wrap preferences better into account?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.18#n658


Hi,

This is the semi-friendly patch-bot of Greg Kroah-Hartman.

Markus, you seem to have sent a nonsensical or otherwise pointless
review comment to a patch submission on a Linux kernel developer mailing
list.  I strongly suggest that you not do this anymore.  Please do not
bother developers who are actively working to produce patches and
features with comments that, in the end, are a waste of time.

Patch submitter, please ignore Markus's suggestion; you do not need to
follow it at all.  The person/bot/AI that sent it is being ignored by
almost all Linux kernel maintainers for having a persistent pattern of
behavior of producing distracting and pointless commentary, and
inability to adapt to feedback.  Please feel free to also ignore emails
from them.

thanks,

greg k-h's patch email bot

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

* Re: [PATCH v2] fjes: Add missing iounmap in fjes_hw_init()
  2025-12-11  7:37 [PATCH v2] fjes: Add missing iounmap in fjes_hw_init() Haoxiang Li
  2025-12-11  9:10 ` Markus Elfring
@ 2025-12-11 17:49 ` Simon Horman
  1 sibling, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-12-11 17:49 UTC (permalink / raw)
  To: Haoxiang Li
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, izumi.taku, netdev,
	linux-kernel, stable

On Thu, Dec 11, 2025 at 03:37:56PM +0800, Haoxiang Li wrote:
> In error paths, add fjes_hw_iounmap() to release the
> resource acquired by fjes_hw_iomap(). Add a goto label
> to do so.
> 
> Fixes: 8cdc3f6c5d22 ("fjes: Hardware initialization routine")
> Cc: stable@vger.kernel.org
> Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
> Signed-off-by: Simon Horman <horms@kernel.org>
> ---
> Changes in v2:
> - Use an idiomatic goto to do the error hanlding.
> - Thanks for pointing out the issues with the patch, Simon!

Likewise thanks for the updates.

Reviewed-by: Simon Horman <horms@kernel.org>

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

end of thread, other threads:[~2025-12-11 17:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-11  7:37 [PATCH v2] fjes: Add missing iounmap in fjes_hw_init() Haoxiang Li
2025-12-11  9:10 ` Markus Elfring
2025-12-11 10:49   ` Greg KH
2025-12-11 17:49 ` 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).