* [PATCH net v5] net: wan: Add checks for NULL for utdm in undo_uhdlc_init and unmap_si_regs
@ 2023-01-12 7:47 Esina Ekaterina
2023-01-14 5:40 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Esina Ekaterina @ 2023-01-12 7:47 UTC (permalink / raw)
To: Zhao Qiang
Cc: lvc-project, netdev, linux-kernel, Eric Dumazet, Esina Ekaterina,
Jakub Kicinski, Paolo Abeni, linuxppc-dev, David S . Miller
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 Astra Linux on behalf of Linux Verification Center
(linuxtesting.org) with SVACE.
Fixes: 8d68100ab4ad ("soc/fsl/qe: fix err handling of ucc_of_parse_tdm")
Signed-off-by: Esina Ekaterina <eesina@astralinux.ru>
---
v5: Fix style
v4: Fix style
v3: Remove braces
v2: Add check for NULL for unmap_si_regs
---
drivers/net/wan/fsl_ucc_hdlc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
index 22edea6ca4b8..1c53b5546927 100644
--- a/drivers/net/wan/fsl_ucc_hdlc.c
+++ b/drivers/net/wan/fsl_ucc_hdlc.c
@@ -1243,9 +1243,11 @@ static int ucc_hdlc_probe(struct platform_device *pdev)
free_dev:
free_netdev(dev);
undo_uhdlc_init:
- iounmap(utdm->siram);
+ if (utdm)
+ iounmap(utdm->siram);
unmap_si_regs:
- iounmap(utdm->si_regs);
+ if (utdm)
+ iounmap(utdm->si_regs);
free_utdm:
if (uhdlc_priv->tsa)
kfree(utdm);
--
2.39.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net v5] net: wan: Add checks for NULL for utdm in undo_uhdlc_init and unmap_si_regs
2023-01-12 7:47 [PATCH net v5] net: wan: Add checks for NULL for utdm in undo_uhdlc_init and unmap_si_regs Esina Ekaterina
@ 2023-01-14 5:40 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-01-14 5:40 UTC (permalink / raw)
To: Esina Ekaterina
Cc: lvc-project, netdev, linux-kernel, edumazet, kuba, pabeni,
linuxppc-dev, davem, qiang.zhao
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 12 Jan 2023 10:47:03 +0300 you wrote:
> 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 Astra Linux on behalf of Linux Verification Center
> (linuxtesting.org) with SVACE.
>
> [...]
Here is the summary with links:
- [net,v5] net: wan: Add checks for NULL for utdm in undo_uhdlc_init and unmap_si_regs
https://git.kernel.org/netdev/net/c/488e0bf7f34a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-14 5:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-12 7:47 [PATCH net v5] net: wan: Add checks for NULL for utdm in undo_uhdlc_init and unmap_si_regs Esina Ekaterina
2023-01-14 5:40 ` patchwork-bot+netdevbpf
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).