[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221223143225.23153-1-eesina@astralinux.ru>
Date: Fri, 23 Dec 2022 17:32:25 +0300
From: Ekaterina Esina <eesina@...ralinux.ru>
To: Zhao Qiang <qiang.zhao@....com>
Cc: Ekaterina Esina <eesina@...ralinux.ru>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
lvc-project@...uxtesting.org
Subject: [PATCH] net-wan: Add check for NULL for utdm in ucc_hdlc_probe
If uhdlc_priv_tsa != 1 then utdm is not initialized.
And if ret != NULL then goto undo_uhdlc_init, where utdm is dereferenced.
Same if dev == NULL.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Ekaterina Esina <eesina@...ralinux.ru>
---
drivers/net/wan/fsl_ucc_hdlc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
index 22edea6ca4b8..2ddb0f71e648 100644
--- a/drivers/net/wan/fsl_ucc_hdlc.c
+++ b/drivers/net/wan/fsl_ucc_hdlc.c
@@ -1243,7 +1243,9 @@ static int ucc_hdlc_probe(struct platform_device *pdev)
free_dev:
free_netdev(dev);
undo_uhdlc_init:
- iounmap(utdm->siram);
+ if (utdm != NULL) {
+ iounmap(utdm->siram);
+ }
unmap_si_regs:
iounmap(utdm->si_regs);
free_utdm:
--
2.30.2
Powered by blists - more mailing lists