Skip to content

Commit

Permalink
mm/slab.c: remove unneed check in cpuup_canceled
Browse files Browse the repository at this point in the history
nc is a member of percpu allocation memory, and cannot be NULL.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Li RongQing <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Acked-by: Christoph Lameter <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
lrq-max authored and torvalds committed May 14, 2019
1 parent a4d3f89 commit 517f9f1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -990,10 +990,8 @@ static void cpuup_canceled(long cpu)

/* cpu is dead; no one can alloc from it. */
nc = per_cpu_ptr(cachep->cpu_cache, cpu);
if (nc) {
free_block(cachep, nc->entry, nc->avail, node, &list);
nc->avail = 0;
}
free_block(cachep, nc->entry, nc->avail, node, &list);
nc->avail = 0;

if (!cpumask_empty(mask)) {
spin_unlock_irq(&n->list_lock);
Expand Down

0 comments on commit 517f9f1

Please sign in to comment.