Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2459547imj; Mon, 18 Feb 2019 06:24:53 -0800 (PST) X-Google-Smtp-Source: AHgI3IZp3JoZ8+CRZAnfVD3fqKMd/8oiJdAqVGMi1oEeuEj1wUy5FkhwvC+o5s4K++jfp1nAU24L X-Received: by 2002:a17:902:6b8a:: with SMTP id p10mr25849955plk.109.1550499893778; Mon, 18 Feb 2019 06:24:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550499893; cv=none; d=google.com; s=arc-20160816; b=BROSxE0IwEw8FdnGDon5jI3A+WldQfypf9b2ncXv8SNcRR/5BpJUvygcCyj6s92g3w mzTtf9CkLh/JUCV5dC7UCxVJrfX1oMjommT+bxUSvNmfFTekPue+yaY63E4px/4BfpK+ wAt/XozRy+RcH6a+zs2X4VRRjK9qICM46pfSFU/YYWaApKWY53wM5ghtGtXrVvanlbed 8pFpzBPwg+gI+ErxmN8GsHtarsDy2hfl3PhYudRFTAXd6ObkAn/4XdnpysgjuUh59YB2 Sn3v+0VZbGNDEKuvLK51ENJWm2q07X++TL15xLaLoO8SFJpeX9+WKb646fiheUmKsB9d 3TAA== 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=m0UR1eZRS4qdaZQOmafmmDI90cX0jkNvSipF+M1OksY=; b=Nf/Uz0u5PeuVlfT5LGrQUqbJbPiyvkZA+SqdVb6dflWAPqKoKDoyEEXkfj88G2voNk 2vUzUBmOD5evY54eVGDYJGVwPspd/z9pNZ+qUOvO6CgzMUmE6OvwJVe/vt4UtGvBL2// s1aLykYlh1tU8wdAY9VDsG933JP3z2w0uDja1K8xo23PWgaIMQeOycarBEjzCDZKFaQq QpFMJ94pPfNP/j44tIjZ2IN//EldlQ2SgKSeL25/sN0a6lCta/jqYU0qUARuar1Xisr5 97t8BicF71IDPkBXdu1R5vrDn1EqxmSNZii0F3sVEbL1HO2QRRs3oR6n+Fyz2aSb50im cT0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NP6ySWVt; 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 l33si13944842pld.142.2019.02.18.06.24.37; Mon, 18 Feb 2019 06:24:53 -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=NP6ySWVt; 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 S2389287AbfBROEI (ORCPT + 99 others); Mon, 18 Feb 2019 09:04:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:46292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389060AbfBROD6 (ORCPT ); Mon, 18 Feb 2019 09:03:58 -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 C09122070B; Mon, 18 Feb 2019 14:03:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498638; bh=M3nDQ8y5l5celtxDdRYx8vnM5uOTT6/6PRv1K9amscU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NP6ySWVt6YRb07zp8TEomyWF49Rb7HB2EZVb0GLbYd0iwqbF8+DU3d2nuJbKiO+eI kTV6Ws9FmQmFfOkAOu1DTOHYYJFjyR/cVHGDCapHvIdS2LQLKeYT8lhC4KxjnUfl6d z7nzU3xNXS8GoslO+r8n/DiYaPGZr45ZUQgW0zW4= 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.4 050/143] video: clps711x-fb: release disp device node in probe() Date: Mon, 18 Feb 2019 14:42:58 +0100 Message-Id: <20190218133530.957152565@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133529.099444112@linuxfoundation.org> References: <20190218133529.099444112@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.4-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 649b32f78c08..c55109524fd5 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