From patchwork Mon Sep 27 14:57:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 212782 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8REvU6Z001521 for ; Mon, 27 Sep 2010 14:57:51 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 40B9D9EF30 for ; Mon, 27 Sep 2010 07:57:29 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qw0-f49.google.com (mail-qw0-f49.google.com [209.85.216.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 942749E844 for ; Mon, 27 Sep 2010 07:57:19 -0700 (PDT) Received: by qwe4 with SMTP id 4so1301053qwe.36 for ; Mon, 27 Sep 2010 07:57:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=NefJIIl1zd4YspI9Yp9gl4hahyL4VDEdCiW62phAXLQ=; b=Lf861itjlMqjB6oeb8doJGfXE20qdMTf/hf354HYwj+n9W0DKTbf0l89Giw8p/sOns tkC1EAUWa+xQoISuYg61M6nnSbmycnBXWlIrIZSKR1KCAWIvjJtg0PvbVf4j1rh4CCNU v5akyP1GIakc4dU5CqkljdIB3+oNSP+GVf5DE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=SHsgF0CspsXGbR4wUMxi2W950p+MBJmYrUCezfQ4sgt14FnIdykycm1r4OYvbX1/wS GTUodWcZ3jxNTDcA6yDgSm5FdXR4eOxKWzvqok1xVbnhv1NI/J6kfik+hEX0IIyY13X0 qkK5aEtI7JjAyDh/AyOiXVIFFWUzBUeQJLrgU= Received: by 10.224.80.203 with SMTP id u11mr5494708qak.384.1285599438124; Mon, 27 Sep 2010 07:57:18 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-7.washdc.fios.verizon.net [74.96.105.7]) by mx.google.com with ESMTPS id t1sm6709369qcs.45.2010.09.27.07.57.16 (version=SSLv3 cipher=RC4-MD5); Mon, 27 Sep 2010 07:57:17 -0700 (PDT) From: Alex Deucher To: airlied@gmail.com, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon/kms: fix potential segfault in r600_ioctl_wait_idle Date: Mon, 27 Sep 2010 10:57:10 -0400 Message-Id: <1285599430-23409-1-git-send-email-alexdeucher@gmail.com> X-Mailer: git-send-email 1.7.1.1 Cc: stable@kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 27 Sep 2010 14:57:51 +0000 (UTC) diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 30a51c3..31f45af 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c @@ -3491,7 +3491,8 @@ void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo) /* r7xx hw bug. write to HDP_DEBUG1 followed by fb read * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL */ - if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740)) { + if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740) && + rdev->vram_scratch.ptr) { void __iomem *ptr = (void *)rdev->vram_scratch.ptr; u32 tmp;