fix [1965730] Device always give force close screen and completely unusable in Éclair build ERC07,rebooted automatically
diff --git a/modules/gralloc/gralloc.cpp b/modules/gralloc/gralloc.cpp
index 257bb4a..40d14dc 100644
--- a/modules/gralloc/gralloc.cpp
+++ b/modules/gralloc/gralloc.cpp
@@ -200,10 +200,16 @@
     pthread_mutex_lock(&m->lock);
     int err = m->pmem_master;
     if (err == -1) {
+        // first time, try to initialize pmem
         err = init_pmem_area_locked(m);
         if (err) {
             m->pmem_master = err;
         }
+    } else if (err < 0) {
+        // pmem couldn't be initialized, never use it
+    } else {
+        // pmem OK
+        err = 0;
     }
     pthread_mutex_unlock(&m->lock);
     return err;