driver core: class: Clear private pointer on registration failures
Clear the class private pointer if __class_register() fails for it, so as to allow its users to verify that the class is usable by checking the value of that pointer. For consistency, clear that pointer before freeing the object pointed to by it in class_release(). Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://lore.kernel.org/r/4463268.LvFx2qVVIh@kreacherSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
Please register or sign in to comment