Skip to contentSkip to conversation

wmi: parse_wdg() should return kernel error codes

PATCH In review Dan Carpenter 2 participants 2 messages Aug 14, 2013 – Sep 3, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wmi: parse_wdg() should return kernel error codes

The current code returns a mix of acpi_status and kernel error codes. It should just return kernel error codes. There are already error paths in this function which return -ENOMEM and that's what the caller expects.

drivers/platform/x86/wmi.c +2 -2
index b13344c..f75ea69 100644
@@ -778,7 +778,7 @@ static bool guid_already_parsed(const char *guid_string)
 /*
  * Parse the _WDG method for the GUID data blocks
  */
-static acpi_status parse_wdg(acpi_handle handle)
+static int parse_wdg(acpi_handle handle)
 {
 	struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
 	union acpi_object *obj;
@@ -810,7 +810,7 @@ static acpi_status parse_wdg(acpi_handle handle)
 
 		wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL);
 		if (!wblock)
-			return AE_NO_MEMORY;
+			return -ENOMEM;
 
 		wblock->handle = handle;
 		wblock->gblock = gblock[i];
#1 lore raw

T24gV2VkLCAyMDEzLTA4LTE0IGF0IDEyOjAyICswMzAwLCBEYW4gQ2FycGVudGVyIHdyb3RlOg0K PiBUaGUgY3VycmVudCBjb2RlIHJldHVybnMgYSBtaXggb2YgYWNwaV9zdGF0dXMgYW5kIGtlcm5l bCBlcnJvciBjb2Rlcy4NCj4gSXQgc2hvdWxkIGp1c3QgcmV0dXJuIGtlcm5lbCBlcnJvciBjb2Rl cy4gIFRoZXJlIGFyZSBhbHJlYWR5IGVycm9yDQo+IHBhdGhzDQo+IGluIHRoaXMgZnVuY3Rpb24g d2hpY2ggcmV0dXJuIC1FTk9NRU0gYW5kIHRoYXQncyB3aGF0IHRoZSBjYWxsZXINCj4gZXhwZWN0 cy4NCg0KQXBwbGllZCwgdGhhbmtzLg0KDQotLSANCk1hdHRoZXcgR2FycmV0dCA8bWF0dGhldy5n YXJyZXR0QG5lYnVsYS5jb20+DQo