diff options
| -rw-r--r-- | drivers/platform/x86/alienware-wmi.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c index 3e17e996021c..541f9514f76f 100644 --- a/drivers/platform/x86/alienware-wmi.c +++ b/drivers/platform/x86/alienware-wmi.c | |||
| @@ -368,12 +368,20 @@ static int alienware_zone_init(struct platform_device *dev) | |||
| 368 | zone_dev_attrs = | 368 | zone_dev_attrs = |
| 369 | kzalloc(sizeof(struct device_attribute) * (quirks->num_zones + 1), | 369 | kzalloc(sizeof(struct device_attribute) * (quirks->num_zones + 1), |
| 370 | GFP_KERNEL); | 370 | GFP_KERNEL); |
| 371 | if (!zone_dev_attrs) | ||
| 372 | return -ENOMEM; | ||
| 373 | |||
| 371 | zone_attrs = | 374 | zone_attrs = |
| 372 | kzalloc(sizeof(struct attribute *) * (quirks->num_zones + 2), | 375 | kzalloc(sizeof(struct attribute *) * (quirks->num_zones + 2), |
| 373 | GFP_KERNEL); | 376 | GFP_KERNEL); |
| 377 | if (!zone_attrs) | ||
| 378 | return -ENOMEM; | ||
| 379 | |||
| 374 | zone_data = | 380 | zone_data = |
| 375 | kzalloc(sizeof(struct platform_zone) * (quirks->num_zones), | 381 | kzalloc(sizeof(struct platform_zone) * (quirks->num_zones), |
| 376 | GFP_KERNEL); | 382 | GFP_KERNEL); |
| 383 | if (!zone_data) | ||
| 384 | return -ENOMEM; | ||
| 377 | 385 | ||
| 378 | for (i = 0; i < quirks->num_zones; i++) { | 386 | for (i = 0; i < quirks->num_zones; i++) { |
| 379 | sprintf(buffer, "zone%02X", i); | 387 | sprintf(buffer, "zone%02X", i); |
| @@ -546,9 +554,9 @@ module_init(alienware_wmi_init); | |||
| 546 | 554 | ||
| 547 | static void __exit alienware_wmi_exit(void) | 555 | static void __exit alienware_wmi_exit(void) |
| 548 | { | 556 | { |
| 549 | alienware_zone_exit(platform_device); | ||
| 550 | remove_hdmi(platform_device); | ||
| 551 | if (platform_device) { | 557 | if (platform_device) { |
| 558 | alienware_zone_exit(platform_device); | ||
| 559 | remove_hdmi(platform_device); | ||
| 552 | platform_device_unregister(platform_device); | 560 | platform_device_unregister(platform_device); |
| 553 | platform_driver_unregister(&platform_driver); | 561 | platform_driver_unregister(&platform_driver); |
| 554 | } | 562 | } |
