Patch "net: dsa: Add missing of_node_put() in dsa_port_parse_of" has been added to the 5.16-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: dsa: Add missing of_node_put() in dsa_port_parse_of

to the 5.16-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-dsa-add-missing-of_node_put-in-dsa_port_parse_of.patch
and it can be found in the queue-5.16 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 822dd2b6d569657d8f87f6b77662df8836a33353
Author: Miaoqian Lin <linmq006@xxxxxxxxx>
Date:   Wed Mar 16 08:26:02 2022 +0000

    net: dsa: Add missing of_node_put() in dsa_port_parse_of
    
    [ Upstream commit cb0b430b4e3acc88c85e0ad2e25f2a25a5765262 ]
    
    The device_node pointer is returned by of_parse_phandle()  with refcount
    incremented. We should use of_node_put() on it when done.
    
    Fixes: 6d4e5c570c2d ("net: dsa: get port type at parse time")
    Signed-off-by: Miaoqian Lin <linmq006@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20220316082602.10785-1-linmq006@xxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 7578b1350f18..e64ef196a984 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -1327,6 +1327,7 @@ static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn)
 		const char *user_protocol;
 
 		master = of_find_net_device_by_node(ethernet);
+		of_node_put(ethernet);
 		if (!master)
 			return -EPROBE_DEFER;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux