stable.vger.kernel.org archive mirror
 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: [ 30/71] drm/ttm: fix the tt_populated check in ttm_tt_destroy()
Date: Sun, 29 Sep 2013 12:27:42 -0700	[thread overview]
Message-ID: <20130929192645.569633620@linuxfoundation.org> (raw)
In-Reply-To: <20130929192643.539596256@linuxfoundation.org>

3.11-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:27 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-29 19:27 [ 00/71] 3.11.3-stable review Greg Kroah-Hartman
2013-09-29 19:27 ` [ 01/71] PCI / ACPI / PM: Clear pme_poll for devices in D3cold on wakeup Greg Kroah-Hartman
2013-09-29 19:27 ` [ 02/71] ARM: OMAP4: Fix clock_get error for GPMC during boot Greg Kroah-Hartman
2013-09-29 19:27 ` [ 03/71] net: usb: cdc_ether: Use wwan interface for Telit modules Greg Kroah-Hartman
2013-09-29 19:27 ` [ 04/71] cifs: fix filp leak in cifs_atomic_open() Greg Kroah-Hartman
2013-09-29 19:27 ` [ 05/71] bgmac: fix internal switch initialization Greg Kroah-Hartman
2013-09-29 19:27 ` [ 06/71] rt2800: change initialization sequence to fix system freeze Greg Kroah-Hartman
2013-09-29 19:27 ` [ 07/71] rt2800: fix wrong TX power compensation Greg Kroah-Hartman
2013-09-29 19:27 ` [ 08/71] timekeeping: Fix HRTICK related deadlock from ntp lock changes Greg Kroah-Hartman
2013-09-29 19:27 ` [ 09/71] sched/cputime: Do not scale when utime == 0 Greg Kroah-Hartman
2013-09-29 19:27 ` [ 10/71] sched/fair: Fix small race where child->se.parent,cfs_rq might point to invalid ones Greg Kroah-Hartman
2013-09-29 19:27 ` [ 11/71] HID: provide a helper for validating hid reports Greg Kroah-Hartman
2013-09-29 19:27 ` [ 12/71] HID: validate feature and input report details Greg Kroah-Hartman
2013-09-29 19:27 ` [ 13/71] HID: multitouch: validate indexes details Greg Kroah-Hartman
2013-09-29 19:27 ` [ 14/71] HID: LG: validate HID output report details Greg Kroah-Hartman
2013-09-29 19:27 ` [ 15/71] HID: zeroplus: validate " Greg Kroah-Hartman
2013-09-29 19:27 ` [ 16/71] HID: lenovo-tpkbd: fix leak if tpkbd_probe_tp fails Greg Kroah-Hartman
2013-09-29 19:27 ` [ 17/71] HID: steelseries: validate output report details Greg Kroah-Hartman
2013-09-29 19:27 ` [ 18/71] HID: sony: validate HID " Greg Kroah-Hartman
2013-09-29 19:27 ` [ 19/71] HID: lenovo-tpkbd: validate " Greg Kroah-Hartman
2013-09-29 19:27 ` [ 20/71] HID: logitech-dj: " Greg Kroah-Hartman
2013-09-29 19:27 ` [ 21/71] usb: gadget: fix a bug and a WARN_ON in dummy-hcd Greg Kroah-Hartman
2013-09-29 19:27 ` [ 22/71] drm/i915: try not to lose backlight CBLV precision Greg Kroah-Hartman
2013-09-29 19:27 ` [ 23/71] drm/i915: fix hpd work vs. flush_work in the pageflip code deadlock Greg Kroah-Hartman
2013-09-29 19:27 ` [ 24/71] drm/i915: fix gpu hang vs. flip stall deadlocks Greg Kroah-Hartman
2013-09-29 19:27 ` [ 25/71] drm/i915: fix wait_for_pending_flips vs gpu hang deadlock Greg Kroah-Hartman
2013-09-29 19:27 ` [ 26/71] drm/i915: do not update cursor in crtc mode set Greg Kroah-Hartman
2013-09-29 19:27 ` [ 27/71] drm/i915: Dont enable the cursor on a disable pipe Greg Kroah-Hartman
2013-09-29 19:27 ` [ 28/71] drm: fix DRM_IOCTL_MODE_GETFB handle-leak Greg Kroah-Hartman
2013-09-29 19:27 ` [ 29/71] drm/ast: fix the ast open key function Greg Kroah-Hartman
2013-09-29 19:27 ` Greg Kroah-Hartman [this message]
2013-09-29 19:27 ` [ 31/71] radeon kms: fix uninitialised hotplug work usage in r100_irq_process() Greg Kroah-Hartman
2013-09-29 19:27 ` [ 32/71] drm/nv50/disp: prevent false output detection on the original nv50 Greg Kroah-Hartman
2013-09-29 19:27 ` [ 33/71] drm/radeon: fix LCD record parsing Greg Kroah-Hartman
2013-09-29 19:27 ` [ 34/71] drm/radeon/dpm: add reclocking quirk for ASUS K70AF Greg Kroah-Hartman
2013-09-29 19:27 ` [ 35/71] drm/radeon: fix endian bugs in hw i2c atom routines Greg Kroah-Hartman
2013-09-29 19:27 ` [ 36/71] drm/radeon: enable UVD interrupts on CIK Greg Kroah-Hartman
2013-09-29 19:27 ` [ 37/71] drm/radeon: fill in gpu_init for berlin GPU cores Greg Kroah-Hartman
2013-09-29 19:27 ` [ 38/71] drm/radeon: update line buffer allocation for dce8 Greg Kroah-Hartman
2013-09-29 19:27 ` [ 39/71] drm/radeon: fix init ordering for r600+ Greg Kroah-Hartman
2013-09-29 19:27 ` [ 40/71] drm/radeon/cik: update gpu_init for an additional berlin gpu Greg Kroah-Hartman
2013-09-29 19:27 ` [ 41/71] drm/radeon: add berlin pci ids Greg Kroah-Hartman
2013-09-29 19:27 ` [ 42/71] drm/radeon/si: Add support for CP DMA to CS checker for compute v2 Greg Kroah-Hartman
2013-09-29 19:27 ` [ 43/71] drm/radeon: update line buffer allocation for dce4.1/5 Greg Kroah-Hartman
2013-09-29 19:27 ` [ 44/71] drm/radeon: update line buffer allocation for dce6 Greg Kroah-Hartman
2013-09-29 19:27 ` [ 45/71] drm/radeon: fix resume on some rs4xx boards (v2) Greg Kroah-Hartman
2013-09-29 19:27 ` [ 46/71] drm/radeon: fix handling of variable sized arrays for router objects Greg Kroah-Hartman
2013-09-29 19:27 ` [ 47/71] drm/radeon/dpm: make sure dc performance level limits are valid (BTC-SI) (v2) Greg Kroah-Hartman
2013-09-29 19:28 ` [ 48/71] tg3: Dont turn off led on 5719 serdes port 0 Greg Kroah-Hartman
2013-09-29 19:28 ` [ 49/71] tg3: Expand led off fix to include 5720 Greg Kroah-Hartman
2013-09-29 19:28 ` [ 50/71] drm/radeon: add some additional berlin pci ids Greg Kroah-Hartman
2013-09-29 19:28 ` [ 51/71] drm/radeon/r6xx: add a stubbed out set_uvd_clocks callback Greg Kroah-Hartman
2013-09-29 19:28 ` [ 52/71] drm/radeon/atom: workaround vbios bug in transmitter table on rs880 (v2) Greg Kroah-Hartman
2013-09-29 19:28 ` [ 53/71] drm/radeon/dpm: handle bapm on trinity Greg Kroah-Hartman
2013-09-29 19:28 ` [ 54/71] drm/radeon/dpm: fix fallback for empty UVD clocks Greg Kroah-Hartman
2013-09-29 19:28 ` [ 55/71] drm/radeon/dpm/rs780: dont enable sclk scaling if not required Greg Kroah-Hartman
2013-09-29 19:28 ` [ 56/71] drm/radeon: fix panel scaling with eDP and LVDS bridges Greg Kroah-Hartman
2013-09-29 19:28 ` [ 57/71] drm/radeon: avoid UVD corruptions on AGP cards Greg Kroah-Hartman
2013-09-29 19:28 ` [ 58/71] skge: fix broken driver Greg Kroah-Hartman
2013-09-29 19:28 ` [ 59/71] udf: Standardize return values in mount sequence Greg Kroah-Hartman
2013-09-29 19:28 ` [ 60/71] udf: Refuse RW mount of the filesystem instead of making it RO Greg Kroah-Hartman
2013-09-29 19:28 ` [ 61/71] audit: fix endless wait in audit_log_start() Greg Kroah-Hartman
2013-09-29 19:28 ` [ 62/71] mm: fix aio performance regression for database caused by THP Greg Kroah-Hartman
2013-09-29 19:28 ` [ 63/71] bio-integrity: Fix use of bs->bio_integrity_pool after free Greg Kroah-Hartman
2013-09-29 19:28 ` [ 64/71] cfq: explicitly use 64bit divide operation for 64bit arguments Greg Kroah-Hartman
2013-09-29 19:28 ` [ 65/71] rpc: clean up decoding of gssproxy linux creds Greg Kroah-Hartman
2013-09-29 19:28 ` [ 66/71] rpc: comment on linux_cred encoding, treat all as unsigned Greg Kroah-Hartman
2013-09-29 19:28 ` [ 67/71] rpc: fix huge kmallocs in gss-proxy Greg Kroah-Hartman
2013-09-29 19:28 ` [ 68/71] rpc: let xdr layer allocate gssproxy receieve pages Greg Kroah-Hartman
2013-09-29 19:28 ` [ 69/71] cw1200: Prevent a lock-related hang in the cw1200_spi driver Greg Kroah-Hartman
2013-09-29 19:28 ` [ 70/71] cw1200: Dont perform SPI transfers in interrupt context Greg Kroah-Hartman
2013-10-02  2:23   ` Solomon Peachy
2013-10-02 21:26     ` Greg Kroah-Hartman
2013-10-03 13:22       ` Solomon Peachy
2013-09-29 19:28 ` [ 71/71] netfilter: ipset: Fix serious failure in CIDR tracking Greg Kroah-Hartman
2013-09-30  1:28 ` [ 00/71] 3.11.3-stable review Guenter Roeck
2013-09-30  1:51   ` Greg Kroah-Hartman
2013-09-30  2:22     ` Guenter Roeck
2013-10-01 19:23 ` 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=20130929192645.569633620@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;
as well as URLs for NNTP newsgroup(s).