Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176735
b: refs/heads/master
c: e006043
h: refs/heads/master
i:
  176733: 83710f4
  176731: 62a6efe
  176727: 351ef74
  176719: 5946c5a
  176703: 213bff6
v: v3
  • Loading branch information
Jack Steiner authored and Linus Torvalds committed Dec 16, 2009
1 parent a9ff38c commit 88da300
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33f3648342dc40f8bd6383a5a1a91c22e06f6b77
refs/heads/master: e006043a4d2da52bba9fd9cb7e5a22e2951ff69b
21 changes: 12 additions & 9 deletions trunk/drivers/misc/sgi-gru/grufault.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,22 @@ static struct gru_thread_state *gru_alloc_locked_gts(unsigned long vaddr)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
struct gru_thread_state *gts = NULL;
struct gru_thread_state *gts = ERR_PTR(-EINVAL);

down_write(&mm->mmap_sem);
vma = gru_find_vma(vaddr);
if (vma)
gts = gru_alloc_thread_state(vma, TSID(vaddr, vma));
if (!IS_ERR(gts)) {
mutex_lock(&gts->ts_ctxlock);
downgrade_write(&mm->mmap_sem);
} else {
up_write(&mm->mmap_sem);
}
if (!vma)
goto err;

gts = gru_alloc_thread_state(vma, TSID(vaddr, vma));
if (IS_ERR(gts))
goto err;
mutex_lock(&gts->ts_ctxlock);
downgrade_write(&mm->mmap_sem);
return gts;

err:
up_write(&mm->mmap_sem);
return gts;
}

Expand Down

0 comments on commit 88da300

Please sign in to comment.