Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3633570imu; Mon, 28 Jan 2019 08:10:20 -0800 (PST) X-Google-Smtp-Source: ALg8bN7MS63thg898hVmdgFwXFIJw7d12achQkLr/AmBD9Z922YxBvNqIiVy8CPJrN5BWrwYnPX9 X-Received: by 2002:a62:ca9c:: with SMTP id y28mr22290443pfk.236.1548691820372; Mon, 28 Jan 2019 08:10:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691820; cv=none; d=google.com; s=arc-20160816; b=ApLXdunCFFGytZQVw2H1R+Bb2CtqJ58myo5QkVkHhTyPOw8q31v+417bC5Px4zmlDm KmBHMdsidofwccUEV7n0GaUw7Z+bi+SLG3l9MZMF4zoKDBubPbMeT0cy5T0/UbZHw8n/ dcOcNLM1pkHbWwBQ4RWsVYoGkBB08nxEwTrGk+uWUFYwDECSTGScjM4WNKalIvDrQe7P NYghA3YwLAw+zWWUxkQcEV1/EqikLOIpInS7S/FXKav7iTkDcr6MvxyP6gfnJ24P+E96 oc6eVMGH3sD6XrAaApAJwQjoNnfB2apahJsPaeY2p4lZOer4Vo3QMygsnh7ypUENvZUE ZZtw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WkqMoTJ4KXtTWRhSvrqcsRCfc4T0JSBP/E4TgVaq/AY=; b=w3cFfs310n0SbuzS6A1WieeGpm09SCM9e7ThnYLWZJJj8uu8xgqvX6JDNTYjrpel7X yOPADYnesAlIaq9zIiVk5RJo1/TzYK4eG1mWWIfY9bWR2E3lQZn90RB3OzuJwddNffE2 7JH3gWRshEIUA3WYoOuRBz2CvubT7/fvO1Fga+CfF8CkNqc4hw3dRML5Fb19BKhA9xnl LlQTM+LyJ/10FRGHErqbI2CzM/4UkY8UG6VJ7sV46jLyH3njNxS1cetfei43QK8c23Ru JpT6PtfiiepAfipw53SA5b2+2bm+tl1kNWi8s/Z7SPyu5Eu72fqA2vJ08y3l05SEBeTj qXNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=forGuKRL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l129si6318544pfl.284.2019.01.28.08.10.04; Mon, 28 Jan 2019 08:10:20 -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=forGuKRL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731655AbfA1QJK (ORCPT + 99 others); Mon, 28 Jan 2019 11:09:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:33416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731941AbfA1QJI (ORCPT ); Mon, 28 Jan 2019 11:09:08 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D3D282084A; Mon, 28 Jan 2019 16:09:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691747; bh=VJHfTeWE69BzaokekwoAcSIM5OmZnXbFokFQuWGBqaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=forGuKRLbmYT/NB65GziIVIBTf8TUuCxBm9yzE8td2+9Nuozvx3cAnb5+0W9LESJA IW8F5xF19bvHufJ5vNN+6vDDZYkIWe1P5iqOojOvlMt+WwLrE9gtdvP+NFTnDzl7+L LV45rWF3EYxvBM8Y1Mo5HNlPHvuvEGHVZSxElvR8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexey Khoroshilov , Alexander Shiyan , Bartlomiej Zolnierkiewicz , Sasha Levin , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 204/258] video: clps711x-fb: release disp device node in probe() Date: Mon, 28 Jan 2019 10:58:30 -0500 Message-Id: <20190128155924.51521-204-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexey Khoroshilov [ 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