diff options
author | Miaoqian Lin <[email protected]> | 2022-05-12 08:44:45 +0400 |
---|---|---|
committer | Corey Minyard <[email protected]> | 2022-05-12 10:00:04 -0500 |
commit | a508e33956b538e034ed5df619a73ec7c15bda72 (patch) | |
tree | f413bb97de9823e8585e1b182e1a865a6a2361c4 | |
parent | 5396ccbd79ab03bd588bcfaa59f58c9bbf9fdcde (diff) |
ipmi:ipmb: Fix refcount leak in ipmi_ipmb_probe
of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.
Fixes: 00d93611f002 ("ipmi:ipmb: Add the ability to have a separate slave and master device")
Signed-off-by: Miaoqian Lin <[email protected]>
Message-Id: <[email protected]>
Cc: [email protected] # v5.17+
Signed-off-by: Corey Minyard <[email protected]>
-rw-r--r-- | drivers/char/ipmi/ipmi_ipmb.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/char/ipmi/ipmi_ipmb.c b/drivers/char/ipmi/ipmi_ipmb.c index 7a83fbb4e379..ab19b4b3317e 100644 --- a/drivers/char/ipmi/ipmi_ipmb.c +++ b/drivers/char/ipmi/ipmi_ipmb.c @@ -475,6 +475,7 @@ static int ipmi_ipmb_probe(struct i2c_client *client) slave_np = of_parse_phandle(dev->of_node, "slave-dev", 0); if (slave_np) { slave_adap = of_get_i2c_adapter_by_node(slave_np); + of_node_put(slave_np); if (!slave_adap) { dev_notice(&client->dev, "Could not find slave adapter\n"); |