git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'intx' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6
[pandora-kernel.git]
/
drivers
/
infiniband
/
core
/
uverbs_mem.c
diff --git
a/drivers/infiniband/core/uverbs_mem.c
b/drivers/infiniband/core/uverbs_mem.c
index
ed550f6
..
db12cc0
100644
(file)
--- a/
drivers/infiniband/core/uverbs_mem.c
+++ b/
drivers/infiniband/core/uverbs_mem.c
@@
-1,6
+1,7
@@
/*
* Copyright (c) 2005 Topspin Communications. All rights reserved.
* Copyright (c) 2005 Cisco Systems. All rights reserved.
/*
* Copyright (c) 2005 Topspin Communications. All rights reserved.
* Copyright (c) 2005 Cisco Systems. All rights reserved.
+ * Copyright (c) 2005 Mellanox Technologies. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
@@
-178,9
+179,10
@@
void ib_umem_release(struct ib_device *dev, struct ib_umem *umem)
up_write(¤t->mm->mmap_sem);
}
up_write(¤t->mm->mmap_sem);
}
-static void ib_umem_account(
void *work_ptr
)
+static void ib_umem_account(
struct work_struct *_work
)
{
{
- struct ib_umem_account_work *work = work_ptr;
+ struct ib_umem_account_work *work =
+ container_of(_work, struct ib_umem_account_work, work);
down_write(&work->mm->mmap_sem);
work->mm->locked_vm -= work->diff;
down_write(&work->mm->mmap_sem);
work->mm->locked_vm -= work->diff;
@@
-210,10
+212,12
@@
void ib_umem_release_on_close(struct ib_device *dev, struct ib_umem *umem)
*/
work = kmalloc(sizeof *work, GFP_KERNEL);
*/
work = kmalloc(sizeof *work, GFP_KERNEL);
- if (!work)
+ if (!work) {
+ mmput(mm);
return;
return;
+ }
- INIT_WORK(&work->work, ib_umem_account
, work
);
+ INIT_WORK(&work->work, ib_umem_account);
work->mm = mm;
work->diff = PAGE_ALIGN(umem->length + umem->offset) >> PAGE_SHIFT;
work->mm = mm;
work->diff = PAGE_ALIGN(umem->length + umem->offset) >> PAGE_SHIFT;