]> git.baikalelectronics.ru Git - kernel.git/commit
platform driver: fix use-after-free in platform_device_del()
authorJerome Marchand <jmarchan@redhat.com>
Mon, 25 Jul 2016 14:13:32 +0000 (16:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2016 13:13:56 +0000 (15:13 +0200)
commit8ffbee7f98f542b99b311a0fd019addec2496623
treee8fddbf53d62ad80abdad94327453010567bef2c
parent83cdc9444208de0852ff3e05dc091e6de6e677b0
platform driver: fix use-after-free in platform_device_del()

In platform_device_del(), the device is still used after a call to
device_del(). At this point there is no guarantee that the device is
still there and there could be a use-after-free access. Move the
call to device_remove_properties() before device_del() to fix that.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/platform.c