From mboxrd@z Thu Jan 1 00:00:00 1970 From: CK Hu Subject: Re: [PATCH 1/7] drm/mediatek: fix possible object reference leak Date: Tue, 9 Apr 2019 13:15:59 +0800 Message-ID: <1554786959.336.1.camel@mtksdaap41> References: <1554307455-40361-1-git-send-email-wen.yang99@zte.com.cn> <1554307455-40361-2-git-send-email-wen.yang99@zte.com.cn> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1554307455-40361-2-git-send-email-wen.yang99@zte.com.cn> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Wen Yang Cc: wang.yi59@zte.com.cn, Philipp Zabel , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Daniel Vetter , Matthias Brugger , linux-arm-kernel@lists.infradead.org List-Id: linux-mediatek@lists.infradead.org Hi, Wen: On Thu, 2019-04-04 at 00:04 +0800, Wen Yang wrote: > The call to of_parse_phandle 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/gpu/drm/mediatek/mtk_hdmi.c:1521:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1509, but without a corresponding object release within this function. > drivers/gpu/drm/mediatek/mtk_hdmi.c:1524:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1509, but without a corresponding object release within this function. For this patch, applied to mediatek-drm-fixes-5.1 [1], thanks. [1] https://github.com/ckhu-mediatek/linux.git-tags/commits/mediatek-drm-fixes-5.1 Regards, CK > > Signed-off-by: Wen Yang > Cc: CK Hu > Cc: Philipp Zabel > Cc: David Airlie > Cc: Daniel Vetter > Cc: Matthias Brugger > Cc: dri-devel@lists.freedesktop.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-mediatek@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > --- > drivers/gpu/drm/mediatek/mtk_hdmi.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c > index 915cc84..ed10f4d 100644 > --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c > +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c > @@ -1516,6 +1516,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, > of_node_put(remote); > > hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np); > + of_node_put(i2c_np); > if (!hdmi->ddc_adpt) { > dev_err(dev, "Failed to get ddc i2c adapter by node\n"); > return -EINVAL;