summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAcorn Pooley <apooley@nvidia.com>2010-04-01 20:28:06 -0700
committerGary King <gking@nvidia.com>2010-04-01 20:06:54 -0800
commit293044ba71d73024a971387dc41716f6c650b619 (patch)
tree7c679d5dfa27ad4ac4adba796421d0fa0ab43b93
parent75bcb77344c4f242f595107d7b89e6a316ac0690 (diff)
Fix NvRmMemUnpin so it ignores NULL memhandles
Change-Id: Iffad8a511bb6434b26e58d8dacf24a5751c23610 Reviewed-on: http://git-master/r/1028 Reviewed-by: Acorn Pooley <apooley@nvidia.com> Tested-by: Acorn Pooley <apooley@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
-rw-r--r--drivers/char/nvmap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/nvmap.c b/drivers/char/nvmap.c
index c9d5ead9781c..85bbbbad6364 100644
--- a/drivers/char/nvmap.c
+++ b/drivers/char/nvmap.c
@@ -2943,8 +2943,10 @@ void NvRmMemUnpinMult(NvRmMemHandle *hMems, NvU32 Count)
for (i=0; i<Count; i++) {
struct nvmap_handle *h = (struct nvmap_handle *)hMems[i];
- BUG_ON(atomic_add_return(0, &h->pin)==0);
- do_wake |= _nvmap_handle_unpin(h);
+ if (h) {
+ BUG_ON(atomic_add_return(0, &h->pin)==0);
+ do_wake |= _nvmap_handle_unpin(h);
+ }
}
if (do_wake) wake_up(&nvmap_pin_wait);