]> git.baikalelectronics.ru Git - kernel.git/commit
drivers: PL011: avoid potential unregister_driver call
authorAndre Przywara <andre.przywara@arm.com>
Thu, 21 May 2015 16:26:14 +0000 (17:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 May 2015 20:08:50 +0000 (13:08 -0700)
commitad4f1451f2e19a6c4f5b5a752648c2282a49e65b
tree955cf1bc032750179e06436143ec3ae4513ef17a
parentd1abe287ddf7503977e2b443d5db32f24aa9d4b8
drivers: PL011: avoid potential unregister_driver call

Although we care about not unregistering the driver if there are
still ports connected during the .remove callback, we do miss this
check in the pl011_probe function. So if the current port allocation
fails, but there are other ports already registered, we will kill
those.
So factor out the port removal into a separate function and use that
in the probe function, too.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Mark Langsdorf <mlangsdo@redhat.com>
Tested-by: Naresh Bhat <nbhat@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/amba-pl011.c