Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2982151yba; Mon, 22 Apr 2019 17:07:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzY5HGcl+TU86T8see0+iEp+bXCqHrdlxhC04tuEF2WSTdBvw8GApvrqeiiH/5YW8XUpkCG X-Received: by 2002:a17:902:b089:: with SMTP id p9mr22986010plr.185.1555978076794; Mon, 22 Apr 2019 17:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555978076; cv=none; d=google.com; s=arc-20160816; b=ViI/NKU6ynx1OtU8P4Q3TXeeJs96i4RYH/AhhmJHCMmwJFr0Xey4mPsFl8ea8Y2X8c zZDwqZ7GsECvaTJUejvF7UuNk8DnoHl2uOBk4uoxttuZ4/2/uI//rwqoY7UfWiYvGglN sIPpArBxZzmFoD047Pw6TehI7f/NbnNYgHTvm3EBVi1MbNT+11lZE87G7MnRP/QEudYN zvNEa5+BVVpOxOvrw54LWkeX6ud9GVXZbP5tNEOt28GAoG4Ey38zabkzrIz8iIReFmf3 5AOw8qsVmnUtyXSu6XI7S78HMar0QBw6Zmjh8CqTE55IHa/lvZ5oErtNCAW6oFHOEAMa U2pA== 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=K5Oj25dQ7m0nQ2xyOfynFu/9a0G7x34LUrio8xtMTP4=; b=COcI1pfup+oka4LSFPbPhdR80c+dyC+jJSDshEAI1gzQWGBWfyRs2vhWkpVTn7yeqZ /lW9e/CHbTXWAPLPeOt1ytHgWL4A7ApkVdSdWnw43WHHuSEKaD3Il33va5ZByae6O7Bc C+0R3Fcv51WLbG2p/6kk0Juor07o92SYQtWqEciAQJ1sa+nO5RkaiydTmXfLUdswW7rE MlFMEj9Lfdh7K2uCMoy/uMYzZPsCVlEF5zwUWVuHjvzXHdqzDI0QDCrifOLoktUH5vGC h+gaOtm4l2xE0pin13Q437tu9lk7+788/IusGmMANm6wTR+2DkXpD2FYv/jSTa626UDd t6GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=m6Cse7Di; 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 x22si2012506plr.254.2019.04.22.17.07.41; Mon, 22 Apr 2019 17:07:56 -0700 (PDT) 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=m6Cse7Di; 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 S1732058AbfDVUC2 (ORCPT + 99 others); Mon, 22 Apr 2019 16:02:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:48990 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730029AbfDVTql (ORCPT ); Mon, 22 Apr 2019 15:46:41 -0400 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 1AA40218B0; Mon, 22 Apr 2019 19:46:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962400; bh=xfNqrguB6GXBrK5MUUyIFj8Yp9Dc8/qkxB2w907HwFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m6Cse7DiwNPtc37kvRzLTp/Nt0terCqTiQRbD8OgcSy8Bc3s2DJO0QLKMCbIhDdK1 jTCneDnnrkqa3CVCtGGlmrYUz+n6PNnEtzcr+Y7/npxd+X+2UeATGUTyexdxSvw8Qw NLrZx2uuYj1UwldJJ5EO7SuHQR+p9CWPBoXBXesQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Thierry Reding , Sasha Levin , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 38/68] drm/tegra: hub: Fix dereference before check Date: Mon, 22 Apr 2019 15:44:46 -0400 Message-Id: <20190422194516.11634-38-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190422194516.11634-1-sashal@kernel.org> References: <20190422194516.11634-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review 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: Thierry Reding [ Upstream commit 7cf77b273a8fc51e7de622fa6691abd4436a9a6b ] Reported-by: Dan Carpenter Signed-off-by: Thierry Reding Signed-off-by: Sasha Levin (Microsoft) --- drivers/gpu/drm/tegra/hub.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c index 8f4fcbb515fb..bb97cad1eb69 100644 --- a/drivers/gpu/drm/tegra/hub.c +++ b/drivers/gpu/drm/tegra/hub.c @@ -378,14 +378,16 @@ static int tegra_shared_plane_atomic_check(struct drm_plane *plane, static void tegra_shared_plane_atomic_disable(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct tegra_dc *dc = to_tegra_dc(old_state->crtc); struct tegra_plane *p = to_tegra_plane(plane); + struct tegra_dc *dc; u32 value; /* rien ne va plus */ if (!old_state || !old_state->crtc) return; + dc = to_tegra_dc(old_state->crtc); + /* * XXX Legacy helpers seem to sometimes call ->atomic_disable() even * on planes that are already disabled. Make sure we fallback to the -- 2.19.1