Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2662569pxj; Mon, 14 Jun 2021 04:20:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkBx3GpVfI5h/8J59SadLRbkadlvLmnrXzU+OulHp4bkJzcsBD6nencnapc0bkoPbndCzG X-Received: by 2002:a17:906:d85:: with SMTP id m5mr14760066eji.55.1623669613140; Mon, 14 Jun 2021 04:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623669613; cv=none; d=google.com; s=arc-20160816; b=r6YVrkvDYoErddmWY/AVhhIJPwHNcENJpxuKqi7p8J9l7JOtceXLPEGJNP+i1YLtNN 8LdGqkGDpxB5aKRhRLHd+bnpQXVqn0hPkMQm3uNuE5XnGPClnA72Z/q0wcLdtFWQrZLh v4hKQSjcay5Ub+Ozz8adrGSAE1Anz5JcYC6pyJv8GcFGCZDEbUiMHt2yGyU2mPzyv4XX KX5tE08YyMY18b8d+u9PVM/Xxi5oMu+fb7uNtQ8WQLU3r32+wrA3OPa7ADvUjflZbzmS yOOy5LhUMTXvdfZvRl7lKoA03zVdE1PLFeGz4ieg6nOMFUDn8BFmDsx0Z0NWVS24/Rqk pmog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mhbNxkdnh4uXs8XA5VYOOFPrXBvIt+aAl917P7L8M/0=; b=pVMldJmGVd7WvFkgzn5qgyJfawgowmz9bOx2NR8IrPH/2sjUMr10+eosM22BEyLXle EIlvp/xPl0Br8i4ws1FY2yJAtPx4WYu1EV1I2FxDIdu0Cnb5kJtcLylLq3+c7S9CrGkW 4yUqvbYR6qGjOJbmB5YzqhD4HXSbDTktyN7aLHhX4FKKOW5oAyW40F/A018ScSk2cuRV jWhri7FC4ze0qAiOr9A7seghz6/7YMjEU5oSQj9BM1uquIHnnUfAuCA4QvhSFlaClXQ4 76Bo+9PkiJjP87/6ZLRsTEtMLKKBSMf6EiFYPMrbuA/xiqRDbR3MUVulCOSSaZ31IuMc OYwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2ZoQlvvz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si7075737edk.517.2021.06.14.04.19.50; Mon, 14 Jun 2021 04:20:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2ZoQlvvz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235447AbhFNLSJ (ORCPT + 99 others); Mon, 14 Jun 2021 07:18:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:39676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232847AbhFNLFt (ORCPT ); Mon, 14 Jun 2021 07:05:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9EFDF61925; Mon, 14 Jun 2021 10:45:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623667518; bh=ho0bdOq5GnYwMGb1t/qr3DNJ4ESJIT4cUkcZnEaefuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2ZoQlvvz7jEIEmVuX721qsl0tEQIjnZ4pD+DcNRwY/O69mu5qVYozDnKQvZE4KxE8 /IzOED0EfxwAJ/QS9tyZ+zWwOu4GGCnA2brFhiqZknY3gDZrul6jyFmBE+N0TurnAR vDZUJnuJMCQ7uP+rhy4By44tGHWBgT1m6ryneIYI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Marek , Akhil P Oommen , Rob Clark Subject: [PATCH 5.10 102/131] drm/msm/a6xx: avoid shadow NULL reference in failure path Date: Mon, 14 Jun 2021 12:27:43 +0200 Message-Id: <20210614102656.466490738@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102652.964395392@linuxfoundation.org> References: <20210614102652.964395392@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonathan Marek commit ce86c239e4d218ae6040bec18e6d19a58edb8b7c upstream. If a6xx_hw_init() fails before creating the shadow_bo, the a6xx_pm_suspend code referencing it will crash. Change the condition to one that avoids this problem (note: creation of shadow_bo is behind this same condition) Fixes: e8b0b994c3a5 ("drm/msm/a6xx: Clear shadow on suspend") Signed-off-by: Jonathan Marek Reviewed-by: Akhil P Oommen Link: https://lore.kernel.org/r/20210513171431.18632-6-jonathan@marek.ca Signed-off-by: Rob Clark Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1128,7 +1128,7 @@ static int a6xx_pm_suspend(struct msm_gp if (ret) return ret; - if (adreno_gpu->base.hw_apriv || a6xx_gpu->has_whereami) + if (a6xx_gpu->shadow_bo) for (i = 0; i < gpu->nr_rings; i++) a6xx_gpu->shadow[i] = 0;