net: dsa: realtek-smi: fix OF child-node lookup
authorJohan Hovold <johan@kernel.org>
Wed, 16 Jan 2019 10:27:08 +0000 (11:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jan 2019 20:40:34 +0000 (21:40 +0100)
commita10cabbf7a7615ab1d868780f15a64b732ea360e
tree14ca93e40c63ae4b300a9fe297129744b4cfed16
parent0098f2e791d72bc6407459c856fec14470783fba
net: dsa: realtek-smi: fix OF child-node lookup

commit 3f1bb6abdf19cfa89860b3bc9e7f31b44b6a0ba1 upstream.

Use the new of_get_compatible_child() helper to look up child nodes to
avoid ever matching non-child nodes elsewhere in the tree.

Also fix up the related struct device_node leaks.

Fixes: d8652956cf37 ("net: dsa: realtek-smi: Add Realtek SMI driver")
Cc: stable <stable@vger.kernel.org> # 4.19: 36156f9241cb0
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/dsa/realtek-smi.c