]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/nouveau/ltc: protect clearing of comptags with mutex
authorBen Skeggs <bskeggs@redhat.com>
Mon, 12 Dec 2016 23:29:55 +0000 (09:29 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 13 Dec 2016 01:40:09 +0000 (11:40 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c

index 39c2a38e54f74e6e2a4af834feca795823a21408..0c7ef250dcafc3cbdad15b5cfe79acfd513314fa 100644 (file)
@@ -47,8 +47,10 @@ nvkm_ltc_tags_clear(struct nvkm_ltc *ltc, u32 first, u32 count)
 
        BUG_ON((first > limit) || (limit >= ltc->num_tags));
 
+       mutex_lock(&ltc->subdev.mutex);
        ltc->func->cbc_clear(ltc, first, limit);
        ltc->func->cbc_wait(ltc);
+       mutex_unlock(&ltc->subdev.mutex);
 }
 
 int