Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2648060imj; Mon, 11 Feb 2019 06:26:33 -0800 (PST) X-Google-Smtp-Source: AHgI3IYPUlu+gX4HFXVuDPBEJUeI5EAPdnEgOF/v8FwPrrehOxzMGoHU3Na2g2s/jUthC0BwXQWx X-Received: by 2002:a63:c56:: with SMTP id 22mr18317206pgm.44.1549895193024; Mon, 11 Feb 2019 06:26:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895193; cv=none; d=google.com; s=arc-20160816; b=ct1aitLDBdvuyT8bQRaC4axF19y0BSof5crEX8qDerakEEvxDE1sCDrq5paCiMX1Z0 wYrPUcLCYGKBgk/G/6IGMSp1joQNS5MSR3gh/uLNBZb2DvSxrcce2X/ZsxrB799uAnAX 8S/HqllOAH76+gYBJArtDRk4RDxdBsE+pW52K2YmwwWR6zVrM98+RR/7bb6HmEWuD9DO JuRh4tdetnj50Zqb1DbP6QrA7Kw9aFUeEKPEdF9RKmNcKbYKyQGQPbRwcWenI2G6V1pl MvUrsLzLsoKnKfYSX/JUdAJuiXLOZebRsyDG1qLthYDqK26wqnmkk4WhwPQQOk9n+MIE 6kig== 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=wMfxNUoM3JwHzr/PF3Dmf6NaB+5fnwmdMiOgVjLqx2Y=; b=xQ4mDn9Qy9gbrfIqVFaP7PGrEi/K04jc7tw4Z1Necu09tabPMMwvppT3hJTH1UIcAN L73JmW+EqSJaP2F8cK+Q8CMkZ9tb5FvPiozTag5LCWfjWVkkr5fd1BYGV5/nd4zr9vJP 8+Qv3Z6TYEZYrc6/9M6wdNGbrDAAjR8ZncXMO97RP87CdPfGr3Gglk3pQMShJVoeuRaY QXgMDESdTOpO4dwnotYwmUinyC3IGYAtAcRkq2iSr6WeqMrOjn6O7FzdSBRJBpkfKI58 GTrV+t9P2ex8XuEqDagBlOwkMGD9sKg2p+2a9IP6rmiOpmgpuafE0bZ1wBd+ClmY81t6 YE0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WQWhwa3a; 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 z4si3024185pgv.534.2019.02.11.06.26.17; Mon, 11 Feb 2019 06:26:33 -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=WQWhwa3a; 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 S1728625AbfBKOV4 (ORCPT + 99 others); Mon, 11 Feb 2019 09:21:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:54780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727807AbfBKOVy (ORCPT ); Mon, 11 Feb 2019 09:21:54 -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 D2193222B6; Mon, 11 Feb 2019 14:21:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549894914; bh=sl3/65gnbN55u/33PWXDOI+hgYejdqgkf1ttKFUTuyo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WQWhwa3awmtSF8soHOcwyWhfbPtYhbUH9LYLPsxZ5sRyLzIshEw7qQgP3Lp1BKKhg 0K7R9r3ufJtLyaUZTRFsrFdUvDLpI49v+fE6lVrUYoLHp2DM3vMOqP2AubccHiwPZ+ 0yBuWyQb3GZw8jHVc3FpKjif8P4xgCC7jiqJGu7A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bhawanpreet Lakha , Aric Cyr , Leo Li , Alex Deucher , Sasha Levin Subject: [PATCH 4.20 013/352] drm/amd/display: Fix potential nullptr error Date: Mon, 11 Feb 2019 15:14:00 +0100 Message-Id: <20190211141847.251717353@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@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.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 4f7129112c2a30331f3045a42026fad82e6cb72b ] [Why] Fix surface/plane potential nullptr [How] add null check Signed-off-by: Bhawanpreet Lakha Reviewed-by: Aric Cyr Acked-by: Leo Li Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 3118ae0e7a87..315a245aedc2 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5333,6 +5333,12 @@ enum surface_update_type dm_determine_update_type_for_commit(struct dc *dc, stru struct dc_stream_update stream_update; enum surface_update_type update_type = UPDATE_TYPE_FAST; + if (!updates || !surface) { + DRM_ERROR("Plane or surface update failed to allocate"); + /* Set type to FULL to avoid crashing in DC*/ + update_type = UPDATE_TYPE_FULL; + goto ret; + } for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { new_dm_crtc_state = to_dm_crtc_state(new_crtc_state); -- 2.19.1