Merge tag 'nf-23-10-12' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf
[platform/kernel/linux-rpi.git] / drivers / of / dynamic.c
index 0a3483e..f63250c 100644 (file)
@@ -890,13 +890,13 @@ int of_changeset_action(struct of_changeset *ocs, unsigned long action,
 {
        struct of_changeset_entry *ce;
 
+       if (WARN_ON(action >= ARRAY_SIZE(action_names)))
+               return -EINVAL;
+
        ce = kzalloc(sizeof(*ce), GFP_KERNEL);
        if (!ce)
                return -ENOMEM;
 
-       if (WARN_ON(action >= ARRAY_SIZE(action_names)))
-               return -EINVAL;
-
        /* get a reference to the node */
        ce->action = action;
        ce->np = of_node_get(np);