Skip to content

Commit 488e0bf

Browse files
Esina Ekaterinakuba-moo
authored andcommitted
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: 8d68100 ("soc/fsl/qe: fix err handling of ucc_of_parse_tdm") Signed-off-by: Esina Ekaterina <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 4bb4db7 commit 488e0bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/wan/fsl_ucc_hdlc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,9 +1243,11 @@ static int ucc_hdlc_probe(struct platform_device *pdev)
12431243
free_dev:
12441244
free_netdev(dev);
12451245
undo_uhdlc_init:
1246-
iounmap(utdm->siram);
1246+
if (utdm)
1247+
iounmap(utdm->siram);
12471248
unmap_si_regs:
1248-
iounmap(utdm->si_regs);
1249+
if (utdm)
1250+
iounmap(utdm->si_regs);
12491251
free_utdm:
12501252
if (uhdlc_priv->tsa)
12511253
kfree(utdm);

0 commit comments

Comments
 (0)