aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/util.c b/mm/util.c
index 5f64026cbb4d..8f18683825bc 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -95,8 +95,8 @@ void *krealloc(const void *p, size_t new_size, gfp_t flags)
95 return (void *)p; 95 return (void *)p;
96 96
97 ret = kmalloc_track_caller(new_size, flags); 97 ret = kmalloc_track_caller(new_size, flags);
98 if (ret) { 98 if (ret && p) {
99 memcpy(ret, p, min(new_size, ks)); 99 memcpy(ret, p, ks);
100 kfree(p); 100 kfree(p);
101 } 101 }
102 return ret; 102 return ret;