Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1620394ybv; Fri, 21 Feb 2020 00:25:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyBOwZyWMCn2sHtZrMw+Ni55RHKYPk7ea869h0FsrCKla9mR8jZhqSXLny3LF8Pe/d37QGx X-Received: by 2002:a05:6830:1555:: with SMTP id l21mr25675337otp.41.1582273555710; Fri, 21 Feb 2020 00:25:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582273555; cv=none; d=google.com; s=arc-20160816; b=PqTZDldUIPfSMy7o0BCixf4fkNyI/7GD6cgBw7LNfdfmMCQIsQlxpaxFYTaduphI6D AI3YSkNYmT1oUSARGcX91BNp29LmNlfDBFQmvWA4Zq0r0w94/ipf5f/OiMi3OSEF94c/ rxQHCBDcmWBgP5om+WxvWEA/sFAFJTr794E2VBkJTTWm45aawlD6L0GBEF3B7SrvQFLm Q/we5Ni/lqHTae0cSMYcwq3cyDsH2box90CjAOAnZU2rMIsKDTvJv/ls6+ZXC4o5UL7x py3wQCfKJfqiY7R68hwqejWr4yICd7v7tNfiUBMUlQHOPlzZf9Ib3ZdQ0i4ay04rhwK8 AgQQ== 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=OuzffY0sMPginXGoviBbiasvq54YPCgMTT0CaQ0mIWs=; b=I8Jgb6f3E2zbpLD4GGBS2shduH1tix7pc+cNi4CejDpwAFgd4NUyIKG/2JYYTL9R2j vrvV5GFvGOMbsDBPvbVbEnnEuBn+lTkHnMqSw3jhR66EP6KyMzdtoonazF9Lg8eAEya4 Si6132tz2aqOIb/niNhCp4V6tvWwQUvIOfKhJ1JtDHcjB/1jRtCod41n9Vz/lbFUyZ2k HaISdipvFTqch2OBAzgPZqqY9s2iG2+TlD0lmZJV2d1bV8Chy95NowejPfSl79/oovYv IAsJr4yHQDrXNW5qnC5Eo9tmCUWA+JAzbNufU4oBoSFMt8C1BgfgMS+5goakmBqc9+Lu A92w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Df1ctL+e; 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 8si420431oix.109.2020.02.21.00.25.43; Fri, 21 Feb 2020 00:25:55 -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=Df1ctL+e; 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 S2388757AbgBUIZH (ORCPT + 99 others); Fri, 21 Feb 2020 03:25:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:37788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388306AbgBUIZF (ORCPT ); Fri, 21 Feb 2020 03:25:05 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 D85AD2469F; Fri, 21 Feb 2020 08:25:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273505; bh=J82JkTofHDDCykmw5UKeVbFfNcfQzl+TMlBOTvHz5nY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Df1ctL+eHaK/b2pvXAFjqADRNLgXmaUgkjIeos4aSPGUHmAjSuBEobvyHZ5qtkUfT zWoOBw6ovLP23gWDBfN6OUybv0DxG50AFAYHSYuGiuPRxnfHfbwgfgu/h/QoqFDmZC N+cnZ1XZIH3GN883taknSm4UShacURRbj3w7fxA4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Skeggs , Sasha Levin Subject: [PATCH 4.19 172/191] drm/nouveau/disp/nv50-: prevent oops when no channel method map provided Date: Fri, 21 Feb 2020 08:42:25 +0100 Message-Id: <20200221072311.291921344@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072250.732482588@linuxfoundation.org> References: <20200221072250.732482588@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Ben Skeggs [ Upstream commit 0e6176c6d286316e9431b4f695940cfac4ffe6c2 ] The implementations for most channel types contains a map of methods to priv registers in order to provide debugging info when a disp exception has been raised. This info is missing from the implementation of PIO channels as they're rather simplistic already, however, if an exception is raised by one of them, we'd end up triggering a NULL-pointer deref. Not ideal... Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=206299 Signed-off-by: Ben Skeggs Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c index bcf32d92ee5a9..50e3539f33d22 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c @@ -74,6 +74,8 @@ nv50_disp_chan_mthd(struct nv50_disp_chan *chan, int debug) if (debug > subdev->debug) return; + if (!mthd) + return; for (i = 0; (list = mthd->data[i].mthd) != NULL; i++) { u32 base = chan->head * mthd->addr; -- 2.20.1