diff options
author | Simon Guo <wei.guo.simon@gmail.com> | 2018-03-07 03:46:04 -0500 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-03-13 00:50:32 -0400 |
commit | 97c6f25d5828b497e3e802b1f7c70187c88df623 (patch) | |
tree | 45f54aeb912c410b93419955aeaa18e97da89517 /drivers/pci/hotplug/pnv_php.c | |
parent | 5ee573e8ef034e687c420cb10911371488d14b10 (diff) |
PCI/hotplug: ppc: correct a php_slot usage after free
In pnv_php_unregister_one(), pnv_php_put_slot() might kfree
php_slot structure. But there is pci_hp_deregister() after
that with php_slot reference.
This patch moves pnv_php_put_slot() to the end of function.
Signed-off-by: Simon Guo <wei.guo.simon@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/pci/hotplug/pnv_php.c')
-rw-r--r-- | drivers/pci/hotplug/pnv_php.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 23da3046f160..d44100687dfe 100644 --- a/drivers/pci/hotplug/pnv_php.c +++ b/drivers/pci/hotplug/pnv_php.c | |||
@@ -919,8 +919,8 @@ static void pnv_php_unregister_one(struct device_node *dn) | |||
919 | return; | 919 | return; |
920 | 920 | ||
921 | php_slot->state = PNV_PHP_STATE_OFFLINE; | 921 | php_slot->state = PNV_PHP_STATE_OFFLINE; |
922 | pnv_php_put_slot(php_slot); | ||
923 | pci_hp_deregister(&php_slot->slot); | 922 | pci_hp_deregister(&php_slot->slot); |
923 | pnv_php_put_slot(php_slot); | ||
924 | } | 924 | } |
925 | 925 | ||
926 | static void pnv_php_unregister(struct device_node *dn) | 926 | static void pnv_php_unregister(struct device_node *dn) |