diff options
author | Tobias Jordan <Tobias.Jordan@elektrobit.com> | 2018-02-15 17:34:55 +0300 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2018-02-19 17:12:59 +0300 |
commit | c795f3052b60b01e80485fad98c53e5e67d093c9 (patch) | |
tree | 7d721a032136282f6dd088d2081c84e5b5630099 /drivers/gpu/ipu-v3 | |
parent | 6d36b7fec60e6f74a15ce4781d30b2aecce85dfc (diff) | |
download | linux-c795f3052b60b01e80485fad98c53e5e67d093c9.tar.xz |
gpu: ipu-v3: pre: fix device node leak in ipu_pre_lookup_by_phandle
Before returning, call of_node_put() for the device node returned by
of_parse_phandle().
Fixes: d2a34232580a ("gpu: ipu-v3: add driver for Prefetch Resolve Engine")
Signed-off-by: Tobias Jordan <Tobias.Jordan@elektrobit.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu/ipu-v3')
-rw-r--r-- | drivers/gpu/ipu-v3/ipu-pre.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c index f1cec3d70498..0f70e8847540 100644 --- a/drivers/gpu/ipu-v3/ipu-pre.c +++ b/drivers/gpu/ipu-v3/ipu-pre.c @@ -129,11 +129,14 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index) if (pre_node == pre->dev->of_node) { mutex_unlock(&ipu_pre_list_mutex); device_link_add(dev, pre->dev, DL_FLAG_AUTOREMOVE); + of_node_put(pre_node); return pre; } } mutex_unlock(&ipu_pre_list_mutex); + of_node_put(pre_node); + return NULL; } |