From: Dennis Zhou Date: Wed, 21 Jun 2017 15:51:09 +0000 (-0400) Subject: percpu: resolve err may not be initialized in pcpu_alloc X-Git-Tag: v4.13-rc1~145^2~2 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=11df02bf9bc1f6fd8416d22c08275e31f8c4f30d;p=linux.git percpu: resolve err may not be initialized in pcpu_alloc From 4a42ecc735cff0015cc73c3d87edede631f4b885 Mon Sep 17 00:00:00 2001 From: Dennis Zhou Date: Wed, 21 Jun 2017 08:07:15 -0700 Add error message to out of space failure for atomic allocations in percpu allocation path to fix -Wmaybe-uninitialized. Signed-off-by: Dennis Zhou Reported-by: Stephen Rothwell Signed-off-by: Tejun Heo --- diff --git a/mm/percpu.c b/mm/percpu.c index a5bc3634d2a9..bd4130a69bbc 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -956,8 +956,10 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved, * tasks to create chunks simultaneously. Serialize and create iff * there's still no empty chunk after grabbing the mutex. */ - if (is_atomic) + if (is_atomic) { + err = "atomic alloc failed, no space left"; goto fail; + } if (list_empty(&pcpu_slot[pcpu_nr_slots - 1])) { chunk = pcpu_create_chunk();