aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Chen <[email protected]>2017-11-15 17:32:10 -0800
committerLinus Torvalds <[email protected]>2017-11-15 18:21:01 -0800
commit9f88faee3ff7d6e8b09c9d23b7d4ac0c15a3eae9 (patch)
tree829cea5144d580e3fe7f04b2ad9b880ee39b33e9
parent852d8be0ad8511611eff18f28dce11d25195b654 (diff)
mm/slob.c: remove an unnecessary check for __GFP_ZERO
Current flow guarantees a valid pointer when handling the __GFP_ZERO case. So remove the unnecessary NULL pointer check. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Miles Chen <[email protected]> Cc: 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]>
-rw-r--r--mm/slob.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slob.c b/mm/slob.c
index 10249160b693..3451ecad8e35 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -330,7 +330,7 @@ static void *slob_alloc(size_t size, gfp_t gfp, int align, int node)
BUG_ON(!b);
spin_unlock_irqrestore(&slob_lock, flags);
}
- if (unlikely((gfp & __GFP_ZERO) && b))
+ if (unlikely(gfp & __GFP_ZERO))
memset(b, 0, size);
return b;
}