PNPACPI: Fix device ref leaking in acpi_pnp_match
authorYinghai Lu <yinghai@kernel.org>
Sat, 3 Mar 2012 21:29:20 +0000 (13:29 -0800)
committerLuis Henriques <luis.henriques@canonical.com>
Mon, 30 Apr 2012 18:15:00 +0000 (19:15 +0100)
commitf5d6a33ab76a17f90d23fdec033ec947f1056325
treeb3b2dab5b34ae7bd7ad5a34f66a131ba10892c5f
parentc2f7317c8ed8f8bd6bd20bee59d643a0d7fdbedb
PNPACPI: Fix device ref leaking in acpi_pnp_match

BugLink: http://bugs.launchpad.net/bugs/981162

commit 89e96ada572fb216e582dbe3f64e1a6939a37f74 upstream.

During testing pci root bus removal, found some root bus bridge is not freed.
If booting with pnpacpi=off, those hostbridge could be freed without problem.
It turns out that some devices reference are not released during acpi_pnp_match.
that match should not hold one device ref during every calling.
Add pu_device calling before returning.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/pnp/pnpacpi/core.c