]> Git Repo - linux.git/commit
ipack/carriers/tpci200: Fix a double free in tpci200_pci_probe
authorLv Yunlong <[email protected]>
Mon, 24 May 2021 09:32:05 +0000 (02:32 -0700)
committerGreg Kroah-Hartman <[email protected]>
Thu, 27 May 2021 12:39:19 +0000 (14:39 +0200)
commit9272e5d0028d45a3b45b58c9255e6e0df53f7ad9
tree42b739d611502de65d460a22704a55a86a61fa2f
parenta53d1202aef122894b6e46116a92174a9123db5d
ipack/carriers/tpci200: Fix a double free in tpci200_pci_probe

In the out_err_bus_register error branch of tpci200_pci_probe,
tpci200->info->cfg_regs is freed by tpci200_uninstall()->
tpci200_unregister()->pci_iounmap(..,tpci200->info->cfg_regs)
in the first time.

But later, iounmap() is called to free tpci200->info->cfg_regs
again.

My patch sets tpci200->info->cfg_regs to NULL after tpci200_uninstall()
to avoid the double free.

Fixes: cea2f7cdff2af ("Staging: ipack/bridges/tpci200: Use the TPCI200 in big endian mode")
Cc: stable <[email protected]>
Acked-by: Samuel Iglesias Gonsalvez <[email protected]>
Signed-off-by: Lv Yunlong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/ipack/carriers/tpci200.c
This page took 0.054116 seconds and 4 git commands to generate.