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 <minipli@googlemail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Mathias Krause 2013-11-05 21:25:32 +01:00 коммит произвёл Rafael J. Wysocki
Родитель e7e92ec93f
Коммит 9968e459f1
1 изменённых файлов: 0 добавлений и 5 удалений

Просмотреть файл

@ -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);