]> Git Repo - linux.git/commitdiff
drm/mediatek: fix possible object reference leak
authorWen Yang <[email protected]>
Wed, 3 Apr 2019 16:04:09 +0000 (00:04 +0800)
committerCK Hu <[email protected]>
Tue, 9 Apr 2019 05:09:43 +0000 (13:09 +0800)
The call to of_parse_phandle 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/gpu/drm/mediatek/mtk_hdmi.c:1521:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1509, but without a corresponding object release within this function.
drivers/gpu/drm/mediatek/mtk_hdmi.c:1524:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1509, but without a corresponding object release within this function.

Signed-off-by: Wen Yang <[email protected]>
Cc: CK Hu <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Matthias Brugger <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: CK Hu <[email protected]>
drivers/gpu/drm/mediatek/mtk_hdmi.c

index 543a25e5765e426bd707b71e509d495b9a7b6cd2..e04e6c293d39d189e87cb9bc1d25e4e840750857 100644 (file)
@@ -1515,6 +1515,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
        of_node_put(remote);
 
        hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np);
+       of_node_put(i2c_np);
        if (!hdmi->ddc_adpt) {
                dev_err(dev, "Failed to get ddc i2c adapter by node\n");
                return -EINVAL;
This page took 0.053028 seconds and 4 git commands to generate.