]> git.karo-electronics.de Git - karo-tx-linux.git/commit
s390/pci: improve unreg_ioat error handling
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Sat, 10 Jun 2017 12:10:00 +0000 (14:10 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 28 Jun 2017 05:32:09 +0000 (07:32 +0200)
commit725708349172f00b86e2bac5c03de360b79aaf65
treebd2186c9804f0ee65849bc155a5ed8e1f44d5f90
parent4dfbd3efe3f0cf9ff1325b87491e1b1fe07afaf1
s390/pci: improve unreg_ioat error handling

DMA tables are freed in zpci_dma_exit_device regardless of the return
code of zpci_unregister_ioat. This could lead to a use after free. On
the other hand during function hot-unplug, zpci_unregister_ioat will
always fail since the function is already gone.

So let zpci_unregister_ioat report success when the function is gone
but don't cleanup the dma table when a function could still have it
in access.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/pci/pci.c
arch/s390/pci/pci_dma.c