gpu: pvr: Fixed error path in cache flush function.
authorJanusz Sobczak <janusz.sobczak@imgtec.com>
Wed, 11 Aug 2010 13:00:12 +0000 (15:00 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:09:42 +0000 (21:09 +0300)
PVRSRVCacheFlushDRIBW returns in the error path without releasing
current->mm->mmap_sem semaphore.
The client application stalls forever and cannot be killed.

Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
pvr/bridged_pvr_bridge.c

index d7d9a8d..7409816 100644 (file)
@@ -705,16 +705,15 @@ static int PVRSRVCacheFlushDRIBW(u32 ui32BridgeID,
        down_read(&current->mm->mmap_sem);
        vma = find_vma(current->mm, start);
        if (vma == NULL || vma->vm_start > start ||
-           vma->vm_end < start + len) {
+           vma->vm_end < start + len)
                pr_err("PVR: %s: invalid address %08lx %zu %c\n",
                                __func__, start, len,
                                type == DRM_PVR2D_CFLUSH_TO_GPU ? 'c' :
                                type == DRM_PVR2D_CFLUSH_FROM_GPU ? 'i' :
                                '?');
-               return 0;
-       }
+       else
+               psRetOUT->eError = FlushCacheDRI(type, start, len);
 
-       psRetOUT->eError = FlushCacheDRI(type, start, len);
        up_read(&current->mm->mmap_sem);
 
        return 0;