summaryrefslogtreecommitdiff
path: root/mm/percpu-km.c
diff options
context:
space:
mode:
authorDennis Zhou <dennisz@fb.com>2017-06-29 17:56:26 +0300
committerTejun Heo <tj@kernel.org>2017-06-29 18:23:38 +0300
commite3efe3db932b55ed34ba32862f568abae32046d0 (patch)
tree3c3e23c3d91b47bd3fd9957a4c4638abb7d53074 /mm/percpu-km.c
parent303abfdf76ea41c228e8b3da73ed3807121a9ca6 (diff)
downloadlinux-e3efe3db932b55ed34ba32862f568abae32046d0.tar.xz
percpu: fix static checker warnings in pcpu_destroy_chunk
From 5021b97f4026334d2c8dfad80797dd1028cddd73 Mon Sep 17 00:00:00 2001 From: Dennis Zhou <dennisz@fb.com> Date: Thu, 29 Jun 2017 07:11:41 -0700 Add NULL check in pcpu_destroy_chunk to correct static checker warnings. Signed-off-by: Dennis Zhou <dennisz@fb.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'mm/percpu-km.c')
-rw-r--r--mm/percpu-km.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/percpu-km.c b/mm/percpu-km.c
index 2b79e43c626f..eb58aa4c0997 100644
--- a/mm/percpu-km.c
+++ b/mm/percpu-km.c
@@ -82,10 +82,13 @@ static void pcpu_destroy_chunk(struct pcpu_chunk *chunk)
{
const int nr_pages = pcpu_group_sizes[0] >> PAGE_SHIFT;
+ if (!chunk)
+ return;
+
pcpu_stats_chunk_dealloc();
trace_percpu_destroy_chunk(chunk->base_addr);
- if (chunk && chunk->data)
+ if (chunk->data)
__free_pages(chunk->data, order_base_2(nr_pages));
pcpu_free_chunk(chunk);
}