diff --git a/drivers/base/platform.c b/drivers/base/platform.c index f1bf7b38d91ca7ac69a5477ed08103f59e151bbe..8075ddc70a17825f4aa39cc52e3ef82d48f31263 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -1153,8 +1153,10 @@ int __init platform_bus_init(void) early_platform_cleanup(); error = device_register(&platform_bus); - if (error) + if (error) { + put_device(&platform_bus); return error; + } error = bus_register(&platform_bus_type); if (error) device_unregister(&platform_bus);