* [PATCH] xfstests: aio-stress, use calloc for thread_info array
@ 2014-01-06 20:50 Jeff Mahoney
0 siblings, 0 replies; only message in thread
From: Jeff Mahoney @ 2014-01-06 20:50 UTC (permalink / raw)
To: xfs; +Cc: dchinner
The thread_info array is assumed to be initialized to 0s, but
that causes a segfault when MALLOC_PERTURB_ is set.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
ltp/aio-stress.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/ltp/aio-stress.c
+++ b/ltp/aio-stress.c
@@ -1413,9 +1413,9 @@ int main(int ac, char **av)
num_threads);
}
- t = malloc(num_threads * sizeof(*t));
+ t = calloc(num_threads, sizeof(*t));
if (!t) {
- perror("malloc");
+ perror("calloc");
exit(1);
}
global_thread_info = t;
--
Jeff Mahoney
SUSE Labs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-01-06 20:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-06 20:50 [PATCH] xfstests: aio-stress, use calloc for thread_info array Jeff Mahoney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).