public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Holger Brunck <holger.brunck@hitachienergy.com>
To: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Cc: andrew+netdev@lunn.ch, chleroy@kernel.org, qiang.zhao@nxp.com,
	Holger Brunck <holger.brunck@hitachienergy.com>
Subject: [PATCH 2/2] net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove
Date: Wed, 29 Apr 2026 13:42:08 +0200	[thread overview]
Message-ID: <20260429114208.941011-2-holger.brunck@hitachienergy.com> (raw)
In-Reply-To: <20260429114208.941011-1-holger.brunck@hitachienergy.com>

If the driver is used in a non tdm mode priv->utdm is a NULL pointer.
Therefore we need to check this pointer first before checking si_regs.

Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
---
 drivers/net/wan/fsl_ucc_hdlc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
index 8155e92af14e..15bfb78381d4 100644
--- a/drivers/net/wan/fsl_ucc_hdlc.c
+++ b/drivers/net/wan/fsl_ucc_hdlc.c
@@ -1250,12 +1250,12 @@ static void ucc_hdlc_remove(struct platform_device *pdev)
 
 	uhdlc_memclean(priv);
 
-	if (priv->utdm->si_regs) {
+	if (priv->utdm && priv->utdm->si_regs) {
 		iounmap(priv->utdm->si_regs);
 		priv->utdm->si_regs = NULL;
 	}
 
-	if (priv->utdm->siram) {
+	if (priv->utdm && priv->utdm->siram) {
 		iounmap(priv->utdm->siram);
 		priv->utdm->siram = NULL;
 	}
-- 
2.52.0.120.gb31ab939fe


  reply	other threads:[~2026-04-29 11:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 11:42 [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean Holger Brunck
2026-04-29 11:42 ` Holger Brunck [this message]
2026-05-01 12:35   ` [PATCH 2/2] net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove Simon Horman
2026-05-01 12:27 ` [PATCH 1/2] net: wan: fsl_ucc_hdlc: fix uhdlc_memclean Simon Horman
2026-05-02 17:14   ` Jakub Kicinski
2026-05-04  5:58   ` Holger Brunck
2026-05-02 17:20 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260429114208.941011-2-holger.brunck@hitachienergy.com \
    --to=holger.brunck@hitachienergy.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=chleroy@kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=qiang.zhao@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox