]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
ACPI / event: remove unneeded NULL pointer check
authorMathias Krause <minipli@googlemail.com>
Tue, 5 Nov 2013 20:25:32 +0000 (21:25 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 7 Nov 2013 13:10:41 +0000 (14:10 +0100)
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>
drivers/acpi/event.c

index 8247fcdde0795b37377bdec44d6271ca16ad225d..fdef416c0ff6f0384e107466b47b1ff8f2bac9aa 100644 (file)
@@ -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);