File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj)
39
39
unsigned long last_pfn = 0 ; /* suppress gcc warning */
40
40
unsigned int max_segment = i915_sg_segment_size ();
41
41
unsigned int sg_page_sizes ;
42
- struct pagevec pvec ;
43
42
gfp_t noreclaim ;
44
43
int ret ;
45
44
@@ -192,13 +191,17 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj)
192
191
sg_mark_end (sg );
193
192
err_pages :
194
193
mapping_clear_unevictable (mapping );
195
- pagevec_init (& pvec );
196
- for_each_sgt_page (page , sgt_iter , st ) {
197
- if (!pagevec_add (& pvec , page ))
194
+ if (sg != st -> sgl ) {
195
+ struct pagevec pvec ;
196
+
197
+ pagevec_init (& pvec );
198
+ for_each_sgt_page (page , sgt_iter , st ) {
199
+ if (!pagevec_add (& pvec , page ))
200
+ check_release_pagevec (& pvec );
201
+ }
202
+ if (pagevec_count (& pvec ))
198
203
check_release_pagevec (& pvec );
199
204
}
200
- if (pagevec_count (& pvec ))
201
- check_release_pagevec (& pvec );
202
205
sg_free_table (st );
203
206
kfree (st );
204
207
You can’t perform that action at this time.
0 commit comments