diff options
author | Miles Chen <miles.chen@mediatek.com> | 2017-11-15 20:32:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-15 21:21:01 -0500 |
commit | 9f88faee3ff7d6e8b09c9d23b7d4ac0c15a3eae9 (patch) | |
tree | 829cea5144d580e3fe7f04b2ad9b880ee39b33e9 /mm/slob.c | |
parent | 852d8be0ad8511611eff18f28dce11d25195b654 (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/1507203141-11959-1-git-send-email-miles.chen@mediatek.com
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slob.c')
-rw-r--r-- | mm/slob.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -330,7 +330,7 @@ static void *slob_alloc(size_t size, gfp_t gfp, int align, int node) | |||
330 | BUG_ON(!b); | 330 | BUG_ON(!b); |
331 | spin_unlock_irqrestore(&slob_lock, flags); | 331 | spin_unlock_irqrestore(&slob_lock, flags); |
332 | } | 332 | } |
333 | if (unlikely((gfp & __GFP_ZERO) && b)) | 333 | if (unlikely(gfp & __GFP_ZERO)) |
334 | memset(b, 0, size); | 334 | memset(b, 0, size); |
335 | return b; | 335 | return b; |
336 | } | 336 | } |