staging: unisys: fix up device_destroy
authorDavid Kershner <david.kershner@unisys.com>
Wed, 27 Sep 2017 17:14:17 +0000 (13:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Sep 2017 09:17:13 +0000 (11:17 +0200)
commitae54a287963f420392a715a4d41aebf773f38614
tree9c606342475b92f45bd88d24487994a45d5cf2f2
parentfd9e450cf5499d6ed6821f2d007e91b729e26092
staging: unisys: fix up device_destroy

Visorbus_remove_instance calls device_unregister which in turn will call
visorbus_release_busdevice. The function visorbus_release_busdevice was
freeing the visor_device. The code in visorbus_remove_instance was then
trying to reference the visor_device. This patch cleans up the code so
the visor_device is not referenced after the unregister.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorbus/visorbus_main.c