]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
staging: greybus: spilib: fix use-after-free after deregistration
authorJohan Hovold <johan@kernel.org>
Sun, 29 Oct 2017 12:01:33 +0000 (13:01 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 14 Mar 2018 10:41:32 +0000 (11:41 +0100)
commit9bd5b28b1550bea7179a85ec554f922b4418d783
treeaa838aa415a1e7f5becf8b55cb24d03770699613
parent8f67c86f3aeb05547c6b53322b51758e37d4c64e
staging: greybus: spilib: fix use-after-free after deregistration

BugLink: http://bugs.launchpad.net/bugs/1744212
commit 770b03c2ca4aa44d226cf248f86aa23e546147d0 upstream.

Remove erroneous spi_master_put() after controller deregistration which
would access the already freed spi controller.

Note that spi_unregister_master() drops our only controller reference.

Fixes: ba3e67001b42 ("greybus: SPI: convert to a gpbridge driver")
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/staging/greybus/spilib.c