[PATCH] xfstests: aio-stress, use calloc for thread_info array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
---

 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@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux