media: mtk-vcodec: Release device nodes in mtk_vcodec_init_enc_pm()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Sat, 20 Oct 2018 17:50:19 +0000 (13:50 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 23 Nov 2018 09:34:10 +0000 (04:34 -0500)
commit8ea0f2ba0fa3f91ea1b8d823a54b042026ada6b3
treecb2be044b882e1506edc3ea807a48169e690c49c
parent56281021d654332fc176563e64da0383e48fc9d8
media: mtk-vcodec: Release device nodes in mtk_vcodec_init_enc_pm()

of_parse_phandle() returns the device node with refcount incremented.
There are two nodes that are used temporary in mtk_vcodec_init_enc_pm(),
but their refcounts are not decremented.

The patch adds one of_node_put() and fixes returning error codes.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c