提交 9968e459 编写于 作者: M Mathias Krause 提交者: Rafael J. Wysocki

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: NMathias Krause <minipli@googlemail.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 e7e92ec9
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册