diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-02-17 18:40:54 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-02-17 18:40:54 -0300 |
commit | 859f7e45542aecaa77fde929232cbcf91b29e11d (patch) | |
tree | 5e81bbb0145bf2467e85ee8106734b4130f52ec0 /tools/lib/subcmd/subcmd-util.h | |
parent | 052747700e914896e8c78ff019411487dc7c12a0 (diff) | |
parent | b3d971ec25346d6890e9e8f05b63f758cfcef8c5 (diff) |
Merge remote-tracking branch 'torvalds/master' into perf/core
To pick up fixes from perf/urgent that recently got merged.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/subcmd/subcmd-util.h')
-rw-r--r-- | tools/lib/subcmd/subcmd-util.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/tools/lib/subcmd/subcmd-util.h b/tools/lib/subcmd/subcmd-util.h index 794a375dad360..b2aec04fce8f6 100644 --- a/tools/lib/subcmd/subcmd-util.h +++ b/tools/lib/subcmd/subcmd-util.h @@ -50,15 +50,8 @@ static NORETURN inline void die(const char *err, ...) static inline void *xrealloc(void *ptr, size_t size) { void *ret = realloc(ptr, size); - if (!ret && !size) - ret = realloc(ptr, 1); - if (!ret) { - ret = realloc(ptr, size); - if (!ret && !size) - ret = realloc(ptr, 1); - if (!ret) - die("Out of memory, realloc failed"); - } + if (!ret) + die("Out of memory, realloc failed"); return ret; } |