drm/sun4i: Fix releasing node when enumerating enpoints
authorJernej Skrabec <jernej.skrabec@siol.net>
Mon, 25 Jun 2018 12:02:46 +0000 (14:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Oct 2018 00:00:51 +0000 (17:00 -0700)
commitc1283a6270a257a3f0658b6b2cef6332e2649df8
tree5c51c4cbe1953bf51f12dea1843fda7a452fc7a2
parent3f7056e1822d648f8022997497edc6cad2ad1e73
drm/sun4i: Fix releasing node when enumerating enpoints

[ Upstream commit 367c359aa8637b15ee8df6335c5a29b7623966ec ]

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
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/sun4i/sun4i_drv.c