From e7e92ec93f218085e37ded8338f717ffd49eed1d Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 29 Oct 2013 10:34:19 +0000 Subject: [PATCH 1/2] ACPI: Fix spelling mistake in error messages Fix spelling mistake "expecing" --> "expecting" Signed-off-by: Colin Ian King Signed-off-by: Rafael J. Wysocki --- drivers/acpi/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index fc2cd3284080..6d408bfbbb1d 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -121,7 +121,7 @@ acpi_extract_package(union acpi_object *package, break; default: printk(KERN_WARNING PREFIX "Invalid package element" - " [%d]: got number, expecing" + " [%d]: got number, expecting" " [%c]\n", i, format_string[i]); return AE_BAD_DATA; @@ -148,7 +148,7 @@ acpi_extract_package(union acpi_object *package, default: printk(KERN_WARNING PREFIX "Invalid package element" " [%d] got string/buffer," - " expecing [%c]\n", + " expecting [%c]\n", i, format_string[i]); return AE_BAD_DATA; break; From 9968e459f1378a1c00301472cfe672497fe001d5 Mon Sep 17 00:00:00 2001 From: Mathias Krause Date: Tue, 5 Nov 2013 21:25:32 +0100 Subject: [PATCH 2/2] ACPI / event: remove unneeded NULL pointer check nla_data() cannot return NULL as it simply adds NLA_HDRLEN to the passed pointer. The NULL pointer check is therefore superfluous. Remove it. Found by smatch: drivers/acpi/event.c:130 acpi_bus_generate_netlink_event() warn: can 'event' even be NULL? Signed-off-by: Mathias Krause Signed-off-by: Rafael J. Wysocki --- drivers/acpi/event.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c index 8247fcdde079..fdef416c0ff6 100644 --- a/drivers/acpi/event.c +++ b/drivers/acpi/event.c @@ -127,11 +127,6 @@ int acpi_bus_generate_netlink_event(const char *device_class, } event = nla_data(attr); - if (!event) { - nlmsg_free(skb); - return -EINVAL; - } - memset(event, 0, sizeof(struct acpi_genl_event)); strcpy(event->device_class, device_class);