diff options
author | Jack Steiner <steiner@sgi.com> | 2009-12-15 19:48:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 10:20:15 -0500 |
commit | 7f2251b1bcdd3d2971b2fde3008b270ea11b8780 (patch) | |
tree | 5fc3a2fc089188a6a61e16374a5b715db280aca7 /drivers/misc/sgi-gru/grufault.c | |
parent | 6c9620c64be3920487c0533e0ab6724dad565d59 (diff) |
gru: handle failures to mmu_notifier_register
Under some conditions, mmu_notifier_register() will fail to register a
mmu_notifier. Fix the GRU driver to correctly handle these failures.
Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-gru/grufault.c')
-rw-r--r-- | drivers/misc/sgi-gru/grufault.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c index 9470303a9cb9..ada7df7e0968 100644 --- a/drivers/misc/sgi-gru/grufault.c +++ b/drivers/misc/sgi-gru/grufault.c | |||
@@ -96,7 +96,7 @@ static struct gru_thread_state *gru_alloc_locked_gts(unsigned long vaddr) | |||
96 | vma = gru_find_vma(vaddr); | 96 | vma = gru_find_vma(vaddr); |
97 | if (vma) | 97 | if (vma) |
98 | gts = gru_alloc_thread_state(vma, TSID(vaddr, vma)); | 98 | gts = gru_alloc_thread_state(vma, TSID(vaddr, vma)); |
99 | if (gts) { | 99 | if (!IS_ERR(gts)) { |
100 | mutex_lock(>s->ts_ctxlock); | 100 | mutex_lock(>s->ts_ctxlock); |
101 | downgrade_write(&mm->mmap_sem); | 101 | downgrade_write(&mm->mmap_sem); |
102 | } else { | 102 | } else { |
@@ -747,8 +747,8 @@ int gru_set_context_option(unsigned long arg) | |||
747 | gru_dbg(grudev, "op %d, gseg 0x%lx, value1 0x%lx\n", req.op, req.gseg, req.val1); | 747 | gru_dbg(grudev, "op %d, gseg 0x%lx, value1 0x%lx\n", req.op, req.gseg, req.val1); |
748 | 748 | ||
749 | gts = gru_alloc_locked_gts(req.gseg); | 749 | gts = gru_alloc_locked_gts(req.gseg); |
750 | if (!gts) | 750 | if (IS_ERR(gts)) |
751 | return -EINVAL; | 751 | return PTR_ERR(gts); |
752 | 752 | ||
753 | switch (req.op) { | 753 | switch (req.op) { |
754 | case sco_blade_chiplet: | 754 | case sco_blade_chiplet: |