diff options
-rw-r--r-- | drivers/char/nvmap.c | 6 |
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); |