Skip to content

Commit

Permalink
net: ibm: fix possible object reference leak
Browse files Browse the repository at this point in the history
The call to ehea_get_eth_dn returns a node pointer with refcount
incremented thus it must be explicitly decremented after the last
usage.

Detected by coccinelle with the following warnings:
./drivers/net/ethernet/ibm/ehea/ehea_main.c:3163:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 3154, but without a corresponding object release within this function.

Signed-off-by: Wen Yang <[email protected]>
Cc: Douglas Miller <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
taskset authored and davem330 committed Mar 24, 2019
1 parent fa3a419 commit be693df
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/ibm/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3160,6 +3160,7 @@ static ssize_t ehea_probe_port(struct device *dev,

if (ehea_add_adapter_mr(adapter)) {
pr_err("creating MR failed\n");
of_node_put(eth_dn);
return -EIO;
}

Expand Down

0 comments on commit be693df

Please sign in to comment.