Skip to content

Commit a508e33

Browse files
Yuuoniycminyard
authored andcommitted
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: 00d9361 ("ipmi:ipmb: Add the ability to have a separate slave and master device") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Message-Id: <20220512044445.3102-1-linmq006@gmail.com> Cc: stable@vger.kernel.org # v5.17+ Signed-off-by: Corey Minyard <cminyard@mvista.com>
1 parent 5396ccb commit a508e33

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/char/ipmi/ipmi_ipmb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ static int ipmi_ipmb_probe(struct i2c_client *client)
475475
slave_np = of_parse_phandle(dev->of_node, "slave-dev", 0);
476476
if (slave_np) {
477477
slave_adap = of_get_i2c_adapter_by_node(slave_np);
478+
of_node_put(slave_np);
478479
if (!slave_adap) {
479480
dev_notice(&client->dev,
480481
"Could not find slave adapter\n");

0 commit comments

Comments
 (0)