aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/percpu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/percpu.c b/mm/percpu.c
index c7206d06f8de..202e104df8a7 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -713,11 +713,14 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved)
713 713
714 /* 714 /*
715 * We want the lowest bit of offset available for in-use/free 715 * We want the lowest bit of offset available for in-use/free
716 * indicator. 716 * indicator, so force >= 16bit alignment and make size even.
717 */ 717 */
718 if (unlikely(align < 2)) 718 if (unlikely(align < 2))
719 align = 2; 719 align = 2;
720 720
721 if (unlikely(size & 1))
722 size++;
723
721 if (unlikely(!size || size > PCPU_MIN_UNIT_SIZE || align > PAGE_SIZE)) { 724 if (unlikely(!size || size > PCPU_MIN_UNIT_SIZE || align > PAGE_SIZE)) {
722 WARN(true, "illegal size (%zu) or align (%zu) for " 725 WARN(true, "illegal size (%zu) or align (%zu) for "
723 "percpu allocation\n", size, align); 726 "percpu allocation\n", size, align);