diff options
Diffstat (limited to 'mm/cma.c')
-rw-r--r-- | mm/cma.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -407,6 +407,7 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, | |||
407 | unsigned long pfn = -1; | 407 | unsigned long pfn = -1; |
408 | unsigned long start = 0; | 408 | unsigned long start = 0; |
409 | unsigned long bitmap_maxno, bitmap_no, bitmap_count; | 409 | unsigned long bitmap_maxno, bitmap_no, bitmap_count; |
410 | size_t i; | ||
410 | struct page *page = NULL; | 411 | struct page *page = NULL; |
411 | int ret = -ENOMEM; | 412 | int ret = -ENOMEM; |
412 | 413 | ||
@@ -466,6 +467,16 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, | |||
466 | 467 | ||
467 | trace_cma_alloc(pfn, page, count, align); | 468 | trace_cma_alloc(pfn, page, count, align); |
468 | 469 | ||
470 | /* | ||
471 | * CMA can allocate multiple page blocks, which results in different | ||
472 | * blocks being marked with different tags. Reset the tags to ignore | ||
473 | * those page blocks. | ||
474 | */ | ||
475 | if (page) { | ||
476 | for (i = 0; i < count; i++) | ||
477 | page_kasan_tag_reset(page + i); | ||
478 | } | ||
479 | |||
469 | if (ret && !no_warn) { | 480 | if (ret && !no_warn) { |
470 | pr_err("%s: alloc failed, req-size: %zu pages, ret: %d\n", | 481 | pr_err("%s: alloc failed, req-size: %zu pages, ret: %d\n", |
471 | __func__, count, ret); | 482 | __func__, count, ret); |