提交 488e0bf7 编写于 作者: E Esina Ekaterina 提交者: Jakub Kicinski

net: wan: Add checks for NULL for utdm in undo_uhdlc_init and unmap_si_regs

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: 8d68100a ("soc/fsl/qe: fix err handling of ucc_of_parse_tdm")
Signed-off-by: NEsina Ekaterina <eesina@astralinux.ru>
Link: https://lore.kernel.org/r/20230112074703.13558-1-eesina@astralinux.ruSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 4bb4db7f
...@@ -1243,9 +1243,11 @@ static int ucc_hdlc_probe(struct platform_device *pdev) ...@@ -1243,9 +1243,11 @@ static int ucc_hdlc_probe(struct platform_device *pdev)
free_dev: free_dev:
free_netdev(dev); free_netdev(dev);
undo_uhdlc_init: undo_uhdlc_init:
iounmap(utdm->siram); if (utdm)
iounmap(utdm->siram);
unmap_si_regs: unmap_si_regs:
iounmap(utdm->si_regs); if (utdm)
iounmap(utdm->si_regs);
free_utdm: free_utdm:
if (uhdlc_priv->tsa) if (uhdlc_priv->tsa)
kfree(utdm); kfree(utdm);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册