of: overlay: remove unneeded check for NULL kbasename()
authorFrank Rowand <frank.rowand@sony.com>
Tue, 17 Oct 2017 23:36:32 +0000 (16:36 -0700)
committerRob Herring <robh@kernel.org>
Wed, 18 Oct 2017 01:47:56 +0000 (20:47 -0500)
kbasename() will not return NULL if passed a valid string.  If
the parameter passed to kbasename() in this case is already NULL
then the devicetree has been corrupted.

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/overlay.c

index 0e9aefc1ff155fdb2561b9d7d371c910077fa42d..c99842bb4b09f0c0e7eb091a211a1c54b5ac7102 100644 (file)
@@ -331,8 +331,6 @@ static int add_changeset_node(struct overlay_changeset *ovcs,
        int ret = 0;
 
        node_kbasename = kbasename(node->full_name);
-       if (!node_kbasename)
-               return -ENOMEM;
 
        for_each_child_of_node(target_node, tchild)
                if (!of_node_cmp(node_kbasename, kbasename(tchild->full_name)))