Skip to content

Commit

Permalink
driver core fixes: device_register() retval check in platform.c
Browse files Browse the repository at this point in the history
Check the return value of device_register() in platform_bus_init().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Cornelia Huck authored and Greg Kroah-Hartman committed Feb 7, 2007
1 parent cb360bb commit fbfb144
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/base/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,15 @@ EXPORT_SYMBOL_GPL(platform_bus_type);

int __init platform_bus_init(void)
{
device_register(&platform_bus);
return bus_register(&platform_bus_type);
int error;

error = device_register(&platform_bus);
if (error)
return error;
error = bus_register(&platform_bus_type);
if (error)
device_unregister(&platform_bus);
return error;
}

#ifndef ARCH_HAS_DMA_GET_REQUIRED_MASK
Expand Down

0 comments on commit fbfb144

Please sign in to comment.