summaryrefslogtreecommitdiff
path: root/blktrace.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-11-14 10:45:23 +0100
committerJens Axboe <jens.axboe@oracle.com>2007-11-14 10:45:23 +0100
commit24c7e97eb6a28a3cfcc966aa2d38af6caed01997 (patch)
tree144856f25418d2908287bcb72d505674d9c51420 /blktrace.c
parent50f7389936188591eda0f114ab682520e6fe90c9 (diff)
downloadblktrace-24c7e97eb6a28a3cfcc966aa2d38af6caed01997.tar.gz
blktrace-24c7e97eb6a28a3cfcc966aa2d38af6caed01997.tar.bz2
memset() must be done after NULL check
Pointed out by Jan Blunck <jblunck@suse.de> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'blktrace.c')
-rw-r--r--blktrace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/blktrace.c b/blktrace.c
index 4f4fcde..4d458ac 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -1220,11 +1220,11 @@ static int start_devices(void)
size = ncpus * sizeof(struct thread_information);
thread_information = malloc(size * ndevs);
- memset(thread_information, 0, size*ndevs);
if (!thread_information) {
fprintf(stderr, "Out of memory, threads (%d)\n", size * ndevs);
return 1;
}
+ memset(thread_information, 0, size * ndevs);
for_each_dip(dip, i) {
if (start_trace(dip)) {