Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2717765imj; Mon, 11 Feb 2019 07:26:51 -0800 (PST) X-Google-Smtp-Source: AHgI3IYY/YhAJWnFg3oq4GmBIBChzf+HUb8okqAkiScitFbcpZM+jhmBsnPYQB4UM5YRZY5IGgEd X-Received: by 2002:a17:902:834b:: with SMTP id z11mr39087592pln.151.1549898811011; Mon, 11 Feb 2019 07:26:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549898811; cv=none; d=google.com; s=arc-20160816; b=MVgTiimp421N3M7qEPBdBlAMEIZHszRSjzLSaCmt7pgah463KwATVLX9aBAT92tt35 oWxd79b6styafbO3DNaJTiJpC2CtS5Q3/PpAnC/N/QcI69x/qPeHxWy8Fq6V1AlLuWA/ JZLnI60pf5NTwuzFBm+XIXurTvJ049UgLAi/VN0R77lGiLPFd9wJc+Tvker9h4d9a3uF g7piGbZhkYvfreSR1NrWw130XMkwmG7Xfsdsiegl/lGaj/bG2/zY5hIPobS3LGot5VTm ZIYKDIfuRgZmUlR5B7e7bh/ob/Srm0/ymECNuwCAV2fCeGvzyK/o8rmU8wQjHbKGmc1W 4N2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0W18NI27EROIcjiF6eUw4063SeFeMobNu7WHvRGTyh4=; b=HdhStnGVzf1rPc8vrhz1t74Uen1abZCLgY/OZZzd3hBbf9wFwUOgZ5YeqsxF9BSWNs fYqFFyWgDRP1IkD14RspjMbVnobxDt41RYgHLlyoylJcMkMvkpk3WkK2sKU9fLPpB4Nl 2mQb36lrFdFTosdwWRkeDNroC1Nco37UIIFwU5hwV00A1wzjZfE5fSSmw2ECpd90c3Ys Mt7I3Cj3syrjCqIv6Krqt9iUrZQtDeMWJg2OQIB3uHdP88Vqp8pb5w6wbHmsELIcyVqa 1bQn2O0cl6ZBv0Z/gCk0TjHPYSEvR6/yZJgs617l+ebmO7rPtHyue5tLXZI30OqRVPHT TdMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mH59SNLK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si9033546pgv.251.2019.02.11.07.26.35; Mon, 11 Feb 2019 07:26:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mH59SNLK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390225AbfBKPBi (ORCPT + 99 others); Mon, 11 Feb 2019 10:01:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:49582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390209AbfBKPBc (ORCPT ); Mon, 11 Feb 2019 10:01:32 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4BB66222A6; Mon, 11 Feb 2019 15:01:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897291; bh=6tSijRtGnJiTMLTN0r2Vbu5c4n8F2JaRl10cNpCmzbg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mH59SNLKv26re96ucKoBr4gtRsAWHXhcYX40E8QcI3jVSG424Zp6SHN36DSTv6gW5 viBtUzUi6iW937GLPgbv7+iMMkCba66asAwCQ/waeVvutDCFEq9C5znYBLcucFS8lw G72HqKv2TVXkKneVFfOM4MzGehFq9hgv+c6pnv0w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Khoroshilov , Alexander Shiyan , Bartlomiej Zolnierkiewicz , Sasha Levin Subject: [PATCH 4.14 122/205] video: clps711x-fb: release disp device node in probe() Date: Mon, 11 Feb 2019 15:18:40 +0100 Message-Id: <20190211141836.433624849@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit fdac751355cd76e049f628afe6acb8ff4b1399f7 ] clps711x_fb_probe() increments refcnt of disp device node by of_parse_phandle() and leaves it undecremented on both successful and error paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Cc: Alexander Shiyan Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Sasha Levin --- drivers/video/fbdev/clps711x-fb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/clps711x-fb.c b/drivers/video/fbdev/clps711x-fb.c index ff561073ee4e..42f909618f04 100644 --- a/drivers/video/fbdev/clps711x-fb.c +++ b/drivers/video/fbdev/clps711x-fb.c @@ -287,14 +287,17 @@ static int clps711x_fb_probe(struct platform_device *pdev) } ret = of_get_fb_videomode(disp, &cfb->mode, OF_USE_NATIVE_MODE); - if (ret) + if (ret) { + of_node_put(disp); goto out_fb_release; + } of_property_read_u32(disp, "ac-prescale", &cfb->ac_prescale); cfb->cmap_invert = of_property_read_bool(disp, "cmap-invert"); ret = of_property_read_u32(disp, "bits-per-pixel", &info->var.bits_per_pixel); + of_node_put(disp); if (ret) goto out_fb_release; -- 2.19.1