]> git.baikalelectronics.ru Git - kernel.git/commit
media: mtk-vcodec: fix leaked of_node references
authorWen Yang <wen.yang99@zte.com.cn>
Mon, 6 May 2019 07:05:17 +0000 (03:05 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 29 May 2019 14:26:09 +0000 (10:26 -0400)
commita3ec588a9492d262b3d37a9265279de006f8a4bf
tree48844f03e2393ed5f4641c7879ad0bd55c403d23
parent0854097ffb7e099ff1f026757d8252e43f90b3c4
media: mtk-vcodec: fix leaked of_node references

The call to of_find_device_by_node 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/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c:60:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 38, but without a corresponding object release within this function.
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c:63:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 38, but without a corresponding object release within this function.
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c:72:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 38, but without a corresponding object release within this function.

Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c