Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux-2.6-microblaze.git] / drivers / net / ethernet / ti / cpsw_new.c
index b33781e..2993193 100644 (file)
@@ -1240,8 +1240,10 @@ static int cpsw_probe_dt(struct cpsw_common *cpsw)
        data->slave_data = devm_kcalloc(dev, CPSW_SLAVE_PORTS_NUM,
                                        sizeof(struct cpsw_slave_data),
                                        GFP_KERNEL);
-       if (!data->slave_data)
+       if (!data->slave_data) {
+               of_node_put(tmp_node);
                return -ENOMEM;
+       }
 
        /* Populate all the child nodes here...
         */
@@ -1335,6 +1337,7 @@ static int cpsw_probe_dt(struct cpsw_common *cpsw)
 
 err_node_put:
        of_node_put(port_np);
+       of_node_put(tmp_node);
        return ret;
 }