From patchwork Tue Jan 14 03:22:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Gleitsmann X-Patchwork-Id: 3483751 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 01AFA9F169 for ; Tue, 14 Jan 2014 03:23:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2211120161 for ; Tue, 14 Jan 2014 03:23:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1580920155 for ; Tue, 14 Jan 2014 03:23:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF5CB107ECC for ; Mon, 13 Jan 2014 19:23:48 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fmailhost05.isp.att.net (fmailhost05.isp.att.net [207.115.11.55]) by gabe.freedesktop.org (Postfix) with ESMTP id E3FE1C32A4; Mon, 13 Jan 2014 19:22:58 -0800 (PST) Received: from [192.168.1.3] (adsl-184-33-99-19.mia.bellsouth.net[184.33.99.19]) by isp.att.net (frfwmhc05) with SMTP id <20140114032257H05008q5eve>; Tue, 14 Jan 2014 03:22:57 +0000 X-Originating-IP: [184.33.99.19] Message-ID: <1389669776.1320.5.camel@s2895bg> Subject: [Fwd: [PATCH] Fix null dereference oopses for nv40 cards] kernel 3.13.0-rc8 From: Bob Gleitsmann To: bskeggs@redhat.com Date: Mon, 13 Jan 2014 22:22:56 -0500 X-Mailer: Evolution 3.8.5 (3.8.5-2.fc19) Mime-Version: 1.0 Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED, 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 I should have mentioned that this applies to Linus' 3.13.0-rc7 and rc8 git. Maybe it's obvious. Sorry about that. Bob -------- Forwarded Message -------- From: Bob Gleitsmann To: bskeggs@redhat.com Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH] Fix null dereference oopses for nv40 cards Date: Mon, 13 Jan 2014 01:45:36 -0500 The problem affects nv40 cards during booting. It comes from there being two places where subdev arrays are maintained. A commit was recently added to make the two equal. However, the struct nouveau_device version ends up being referenced before it is initialized. The problem arises during the creation of the INSTMEM and THERM subdevs. ' Signed off by: Bob Gleitsmann rjgleits@bellsouth.net diff --git a/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c index b10a143..0f494ca 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c +++ b/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c @@ -23,6 +23,7 @@ */ #include +#include #include "nv04.h" @@ -38,6 +39,7 @@ nv40_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ret = nouveau_instmem_create(parent, engine, oclass, &priv); *pobject = nv_object(priv); + device->subdev[NVDEV_SUBDEV_INSTMEM] = *pobject; if (ret) return ret; diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c index 002e51b..59b25be 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c @@ -187,9 +187,11 @@ nv40_therm_ctor(struct nouveau_object *parent, { struct nv40_therm_priv *priv; int ret; + struct nouveau_device *device = nv_device(parent); ret = nouveau_therm_create(parent, engine, oclass, &priv); *pobject = nv_object(priv); + device->subdev[NVDEV_SUBDEV_THERM] = *pobject; if (ret) return ret;