diff options
Diffstat (limited to 'drivers/hwmon/amd_energy.c')
-rw-r--r-- | drivers/hwmon/amd_energy.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwmon/amd_energy.c b/drivers/hwmon/amd_energy.c index bc8b643a37d5..e95b7426106e 100644 --- a/drivers/hwmon/amd_energy.c +++ b/drivers/hwmon/amd_energy.c @@ -379,8 +379,10 @@ static int __init amd_energy_init(void) return ret; amd_energy_platdev = platform_device_alloc(DRVNAME, 0); - if (!amd_energy_platdev) + if (!amd_energy_platdev) { + platform_driver_unregister(&amd_energy_driver); return -ENOMEM; + } ret = platform_device_add(amd_energy_platdev); if (ret) { |