Skip to content
Commit 71150d22 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

PNP: Avoid leaving unregistered device objects in lists



pnp_register_protocol() and __pnp_add_device() both have a problem
that if device_register() fails, the objects they create will be left
in the lists they have been put one beforehand.  Unfortunately, that
is not handled by the callers of those routines either, so in case
of a device registration errors the PNP bus type's data structures
will end up in an inconsistent state.

Make pnp_register_protocol() and __pnp_add_device() remove the
objects from the lists if device registration fails.

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 38f6b38d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment