Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2724195imj; Mon, 11 Feb 2019 07:32:38 -0800 (PST) X-Google-Smtp-Source: AHgI3Iaq6ob7CvEZq8YD9PFNLQP/CinrRblu45K0YW/EtXGC67BtzjibrHC5Rh0qo75AliGgh2Q0 X-Received: by 2002:a62:be0c:: with SMTP id l12mr36450743pff.51.1549899158329; Mon, 11 Feb 2019 07:32:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549899158; cv=none; d=google.com; s=arc-20160816; b=k5YX5Yll27BKKGqcZlK/5yaMOfBQdVWnRjrrP/aWQ29UECv3vXrHkgZzNwgxArLgk3 +357V7GVEZejdcOkch+fXfSYMWhTyJQf5HMR2H0xSaqVxKexO1OWcbLBki3+Uxrzwd2n q6ijPgZBLt8Y8IYlgF7hZgsHBsxxjmpQn1JUSaNlGxy8oACTJy1yeY/rcXm0kj77c1dN k08QbbtPgZZE6O5CffEiHovZgwhe7z+diTZ0MC/q5FzgLPQ4zhs1G0zaHFDQ6lO3HOUO pKD54sH7Ozt/LCko3JF277TH0TtTCz0PTgDaHcFY7eapYWlA/m/dcDB9nfoyDBed+UzN kiTA== 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=IYu4pMtln9DuGb9Gh5HNju73M4UZgZ7zcXuuAV8hAWc=; b=LK5WQL7ufqOdvZjGa1y+cjL19uYHuXfJwjtbMjfTXY1omCJF7hCduGJy7HFrAZGF6T NwVS0YYgi20ndoaxbycPtWwJR4NVbOth80pm/XKwrg9mKIo884XTeZEwzAV7cdZfxMdJ zPcd/0K7/HMbxT28uZozjUJWFum2y3z5bFY6ZNeOkNURs64quKxfp5QdWn+i9YvCj/9Q ie8G546H3uaIAagXVN6mwlzK8H8gm4vBN+s9g36DzJZyYa7GGDF2DUaz5GBJEQBca+os Nmh/cI+2akWPIBGkJi2ybk1zUbfek0qM/ow9LtCGdiVdJhX0toyhK9sqH6PNshdC+0UL Xq7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vlUYIsb7; 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 z9si10222825pgf.54.2019.02.11.07.32.21; Mon, 11 Feb 2019 07:32:38 -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=vlUYIsb7; 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 S2389748AbfBKPaK (ORCPT + 99 others); Mon, 11 Feb 2019 10:30:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:43958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389220AbfBKO4m (ORCPT ); Mon, 11 Feb 2019 09:56:42 -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 7B4362229E; Mon, 11 Feb 2019 14:56:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897002; bh=SOm/r3+4ZRDLcxNssYHn0tU9x3XO7ZzSamxI5a1GacU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vlUYIsb7HX94kwd2Tem3QxmX3BzcGfHGcoFJCAS7wEay+vbQqdAwm6lJFWlTZhDqB 8OWw1p0yV4lgHuuZgNGsV5GVm91XKSth/5NvtZ2c6C4XG6F1IWMEIM/W9wJijPcGc5 qk0wyriKil2DLMokY+ruisRlsUMnrSJez8bM8WIY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Vetter , Daniel Vetter , Sean Paul , Sasha Levin Subject: [PATCH 4.14 051/205] drm: Clear state->acquire_ctx before leaving drm_atomic_helper_commit_duplicated_state() Date: Mon, 11 Feb 2019 15:17:29 +0100 Message-Id: <20190211141832.192075380@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 aa394b0dd68cb00c483e151dcd84713d4d517ed1 ] drm_atomic_helper_commit_duplicated_state() sets state->acquire_ctx to the context given in the argument and leaves it in state after it quits. The lifetime of state and context are not guaranteed to be the same, so we shouldn't leave that pointer hanging around. This patch resets the context to NULL to avoid any oopses. Changes in v2: - Added to the set Suggested-by: Daniel Vetter Reviewed-by: Daniel Vetter Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20181129150423.239081-1-sean@poorly.run Signed-off-by: Sasha Levin --- drivers/gpu/drm/drm_atomic_helper.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 1f08d597b87a..d05ed0521e20 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -2899,7 +2899,7 @@ EXPORT_SYMBOL(drm_atomic_helper_suspend); int drm_atomic_helper_commit_duplicated_state(struct drm_atomic_state *state, struct drm_modeset_acquire_ctx *ctx) { - int i; + int i, ret; struct drm_plane *plane; struct drm_plane_state *new_plane_state; struct drm_connector *connector; @@ -2918,7 +2918,11 @@ int drm_atomic_helper_commit_duplicated_state(struct drm_atomic_state *state, for_each_new_connector_in_state(state, connector, new_conn_state, i) state->connectors[i].old_state = connector->state; - return drm_atomic_commit(state); + ret = drm_atomic_commit(state); + + state->acquire_ctx = NULL; + + return ret; } EXPORT_SYMBOL(drm_atomic_helper_commit_duplicated_state); -- 2.19.1