public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Ben Skeggs <bskeggs@redhat.com>,
	Thomas Hellstrom <thellstrom@vmware.com>,
	Jerome Glisse <jglisse@redhat.com>,
	Dave Airlie <airlied@redhat.com>
Subject: [ 08/22] drm/ttm: fix the tt_populated check in ttm_tt_destroy()
Date: Sun, 29 Sep 2013 12:26:54 -0700	[thread overview]
Message-ID: <20130929191159.456302102@linuxfoundation.org> (raw)
In-Reply-To: <20130929191158.889693326@linuxfoundation.org>

3.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ben Skeggs <bskeggs@redhat.com>

commit 182b17c8dc4e83aab000ce86587b6810e515da87 upstream.

After a vmalloc failure in ttm_dma_tt_alloc_page_directory(),
ttm_dma_tt_init() will call ttm_tt_destroy() to cleanup, and end up
inside the driver's unpopulate() hook when populate() has never yet
been called.

On nouveau, the first issue to be hit because of this is that
dma_address[] may be a NULL pointer.  After working around this,
ttm_pool_unpopulate() may potentially hit the same issue with
the pages[] array.

It seems to make more sense to avoid calling unpopulate on already
unpopulated TTMs than to add checks to all the implementations.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/ttm/ttm_tt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -170,7 +170,7 @@ void ttm_tt_destroy(struct ttm_tt *ttm)
 		ttm_tt_unbind(ttm);
 	}
 
-	if (likely(ttm->pages != NULL)) {
+	if (ttm->state == tt_unbound) {
 		ttm->bdev->driver->ttm_tt_unpopulate(ttm);
 	}
 



  parent reply	other threads:[~2013-09-29 19:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-29 19:26 [ 00/22] 3.4.64-stable review Greg Kroah-Hartman
2013-09-29 19:26 ` [ 01/22] Revert "sctp: fix call to SCTP_CMD_PROCESS_SACK in sctp_cmd_interpreter()" Greg Kroah-Hartman
2013-09-29 19:26 ` [ 02/22] net: usb: cdc_ether: Use wwan interface for Telit modules Greg Kroah-Hartman
2013-09-29 19:26 ` [ 03/22] rt2800: fix wrong TX power compensation Greg Kroah-Hartman
2013-09-29 19:26 ` [ 04/22] sched/fair: Fix small race where child->se.parent,cfs_rq might point to invalid ones Greg Kroah-Hartman
2013-09-29 19:26 ` [ 05/22] HID: provide a helper for validating hid reports Greg Kroah-Hartman
2013-09-29 19:26 ` [ 06/22] HID: zeroplus: validate output report details Greg Kroah-Hartman
2013-09-29 19:26 ` [ 07/22] HID: logitech-dj: " Greg Kroah-Hartman
2013-09-29 19:26 ` Greg Kroah-Hartman [this message]
2013-09-29 19:26 ` [ 09/22] drm/radeon: fix LCD record parsing Greg Kroah-Hartman
2013-09-29 19:26 ` [ 10/22] drm/radeon: fix endian bugs in hw i2c atom routines Greg Kroah-Hartman
2013-09-29 19:26 ` [ 11/22] drm/radeon: update line buffer allocation for dce4.1/5 Greg Kroah-Hartman
2013-09-29 19:26 ` [ 12/22] drm/radeon: update line buffer allocation for dce6 Greg Kroah-Hartman
2013-09-29 19:26 ` [ 13/22] drm/radeon: fix resume on some rs4xx boards (v2) Greg Kroah-Hartman
2013-09-29 19:27 ` [ 14/22] drm/radeon: fix handling of variable sized arrays for router objects Greg Kroah-Hartman
2013-09-29 19:27 ` [ 15/22] drm/radeon/atom: workaround vbios bug in transmitter table on rs880 (v2) Greg Kroah-Hartman
2013-09-29 19:27 ` [ 16/22] cgroup: fail if monitored file and event_control are in different cgroup Greg Kroah-Hartman
2013-09-29 19:27 ` [ 17/22] perf: Clarify perf_cpu_context::active_pmu usage by renaming it to ::unique_pmu Greg Kroah-Hartman
2013-09-29 19:27 ` [ 18/22] perf: Fix perf_cgroup_switch for sw-events Greg Kroah-Hartman
2013-09-29 19:27 ` [ 19/22] fanotify: dont merge permission events Greg Kroah-Hartman
2013-09-29 19:27 ` [ 20/22] perf tools: Handle JITed code in shared memory Greg Kroah-Hartman
2013-09-29 19:27 ` [ 21/22] sfc: Fix efx_rx_buf_offset() for recycled pages Greg Kroah-Hartman
2013-09-29 19:27 ` [ 22/22] kernel-doc: bugfix - multi-line macros Greg Kroah-Hartman
2013-09-30  1:26 ` [ 00/22] 3.4.64-stable review Guenter Roeck
2013-09-30  1:50   ` Greg Kroah-Hartman
2013-10-01 19:25 ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130929191159.456302102@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=airlied@redhat.com \
    --cc=bskeggs@redhat.com \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=thellstrom@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox