Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm...
[sfrench/cifs-2.6.git] / drivers / gpu / drm / etnaviv / etnaviv_gem.c
index c60752ef73244298f48dc0e732eddf8849896f79..e8778ebb72e6108031efb74399686c3ea052bb8d 100644 (file)
@@ -622,24 +622,18 @@ int etnaviv_gem_new_handle(struct drm_device *dev, struct drm_file *file,
        lockdep_set_class(&to_etnaviv_bo(obj)->lock, &etnaviv_shm_lock_class);
 
        ret = drm_gem_object_init(dev, obj, size);
-       if (ret == 0) {
-               struct address_space *mapping;
-
-               /*
-                * Our buffers are kept pinned, so allocating them
-                * from the MOVABLE zone is a really bad idea, and
-                * conflicts with CMA. See comments above new_inode()
-                * why this is required _and_ expected if you're
-                * going to pin these pages.
-                */
-               mapping = obj->filp->f_mapping;
-               mapping_set_gfp_mask(mapping, GFP_HIGHUSER |
-                                    __GFP_RETRY_MAYFAIL | __GFP_NOWARN);
-       }
-
        if (ret)
                goto fail;
 
+       /*
+        * Our buffers are kept pinned, so allocating them from the MOVABLE
+        * zone is a really bad idea, and conflicts with CMA. See comments
+        * above new_inode() why this is required _and_ expected if you're
+        * going to pin these pages.
+        */
+       mapping_set_gfp_mask(obj->filp->f_mapping, GFP_HIGHUSER |
+                            __GFP_RETRY_MAYFAIL | __GFP_NOWARN);
+
        etnaviv_gem_obj_add(dev, obj);
 
        ret = drm_gem_handle_create(file, obj, handle);