From patchwork Mon Apr 20 18:22:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Stone X-Patchwork-Id: 6243751 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 624539F32B for ; Mon, 20 Apr 2015 18:23:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 972A620454 for ; Mon, 20 Apr 2015 18:23:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C11A92034F for ; Mon, 20 Apr 2015 18:23:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 20A836E37E; Mon, 20 Apr 2015 11:23:13 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [93.93.135.160]) by gabe.freedesktop.org (Postfix) with ESMTP id 91EC46E37E for ; Mon, 20 Apr 2015 11:23:12 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: daniels) with ESMTPSA id 612A96003E4 From: Daniel Stone To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/7] drm/atomic: Early-exit from CRTC dup state Date: Mon, 20 Apr 2015 19:22:51 +0100 Message-Id: <1429554176-9865-3-git-send-email-daniels@collabora.com> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1429554176-9865-1-git-send-email-daniels@collabora.com> References: <1429554176-9865-1-git-send-email-daniels@collabora.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Just change an if (success) branch to if (fail) return; Signed-off-by: Daniel Stone --- drivers/gpu/drm/drm_atomic_helper.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index d536817..60eb505 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1983,12 +1983,13 @@ drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc) state = kmemdup(crtc->state, sizeof(*crtc->state), GFP_KERNEL); - if (state) { - state->mode_changed = false; - state->active_changed = false; - state->planes_changed = false; - state->event = NULL; - } + if (!state) + return NULL; + + state->mode_changed = false; + state->active_changed = false; + state->planes_changed = false; + state->event = NULL; return state; }