projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19f3ebe
)
drm/sun4i: Fix releasing node when enumerating enpoints
author
Jernej Skrabec
<jernej.skrabec@siol.net>
Mon, 25 Jun 2018 12:02:46 +0000
(14:02 +0200)
committer
Maxime Ripard
<maxime.ripard@bootlin.com>
Wed, 27 Jun 2018 19:43:49 +0000
(21:43 +0200)
sun4i_drv_add_endpoints() has a memory leak since it uses of_node_put()
when remote is equal to NULL and does nothing when remote has a valid
pointer.
Invert the logic to fix memory leak.
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link:
https://patchwork.freedesktop.org/patch/msgid/20180625120304.7543-7-jernej.skrabec@siol.net
drivers/gpu/drm/sun4i/sun4i_drv.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/sun4i/sun4i_drv.c
b/drivers/gpu/drm/sun4i/sun4i_drv.c
index 50d19605c38fb38ac90fe7778d1b2f6bb069ccd3..e15fa2389e3f42a22424bfbbe381e5b98300abb3 100644
(file)
--- a/
drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/
drivers/gpu/drm/sun4i/sun4i_drv.c
@@
-283,7
+283,6
@@
static int sun4i_drv_add_endpoints(struct device *dev,
remote = of_graph_get_remote_port_parent(ep);
if (!remote) {
DRM_DEBUG_DRIVER("Error retrieving the output node\n");
- of_node_put(remote);
continue;
}
@@
-297,11
+296,13
@@
static int sun4i_drv_add_endpoints(struct device *dev,
if (of_graph_parse_endpoint(ep, &endpoint)) {
DRM_DEBUG_DRIVER("Couldn't parse endpoint\n");
+ of_node_put(remote);
continue;
}
if (!endpoint.id) {
DRM_DEBUG_DRIVER("Endpoint is our panel... skipping\n");
+ of_node_put(remote);
continue;
}
}