Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2656292imj; Mon, 11 Feb 2019 06:33:51 -0800 (PST) X-Google-Smtp-Source: AHgI3IZMw69jXLh79hz302HAf7TbVNCPMnaH5Yd8mPx9yKH/5WM5jjuAUc5yhtdulJfB3f6+XBdf X-Received: by 2002:a62:29c3:: with SMTP id p186mr37485042pfp.117.1549895631583; Mon, 11 Feb 2019 06:33:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895631; cv=none; d=google.com; s=arc-20160816; b=PJqWkygqPg0cCBIvg1AK646vH891x5GYvLJU/zFOtEEXvMBCcA7hWMeeccZjBO9WKZ JvIvmgHycX0hyCGWRE3oikZwAYxvWKo6eq73Snqi3Xu7xHhvSBnlzBELz++X9m45BuXP E4Dykva5tEDqKB3IWnVAkqbDJAbS4jr5GOo6j5iwQ5KTWNJs7Oas+XovayPKmADtGXqi 6pvD/EGvTW54y6u22VC3j4pW+DUjOMAfJx3ya0WPW10M/9XKRgfGHG7K5QXOtbvv2fzb PqJR1d4c2RdFBlUec/ook+iV9ooIclqwiIOFbhEoxBVf4BFfwaz5lhz8cYo0eXaXJZ75 gXnw== 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=FdqWH0ULVT4Dx0MoQqAq47gzsJCkuz581IUXAVCjpwg=; b=0cVD/uM+CCjBCYhev4tF119/k6diKFgkNMjifpdI41I6I7BgKLXzNV3a5CFzgChJXz mcektJ0UIhm4MOd6wepX9eCs4tRyTKJGTnY2cRhi3xwkLirvCuPewaQ+F0PynBjDPLnW lN6+MzPuQYegaFVedSdELbQ8UmWvct5o/xwA5DeI+YPsw81qik/2S55qsMIBsEmFEJ3S 0xU0g2FIKfd5aXvpAU5Lxb95qfdQz+nVyVX35nBag7SXJhZuP2Jz3j815NGJBjDT5f6E oO1GLY3qpZ0W5H/gfdmH4Jkbs+vzyjYh1kC14FKx6JVciVcx7kmAqVRzRYAq4Tju3qeu RnpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=URQcOQHX; 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 p22si9708220pgl.340.2019.02.11.06.33.35; Mon, 11 Feb 2019 06:33:51 -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=URQcOQHX; 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 S1730417AbfBKOcE (ORCPT + 99 others); Mon, 11 Feb 2019 09:32:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:39222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730410AbfBKOcC (ORCPT ); Mon, 11 Feb 2019 09:32:02 -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 6473120675; Mon, 11 Feb 2019 14:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895521; bh=vDx21TKmpDy7Zlhu78bfDT2cMm98FW2guYuOuI8cYf8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=URQcOQHXB4kPom48cU2bEXZfQnzxCdEwHnhFOjSegLAsJen+3anoJMb0QHN5zUz9I oi4xlUbU4/LVRKb7xv/Oi/tUZgXxWaRxVDx7ahguBbYwz+OPRzfNTuGX6PqjxBPNCD 0Pbfz3de9SLVt4l8oGPsa4Lm/Y6Vk8/42ZjoAqTc= 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.20 232/352] video: clps711x-fb: release disp device node in probe() Date: Mon, 11 Feb 2019 15:17:39 +0100 Message-Id: <20190211141901.970850703@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@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.20-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