]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/crypto/isa-l/isa-l_crypto/sha1_mb/sha1_mb_rand_test.c
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / crypto / isa-l / isa-l_crypto / sha1_mb / sha1_mb_rand_test.c
index f818b39eba80040ed148073218644294078148bc..4eeeaba0adac3e534ca521355d0c55c368a8fddf 100644 (file)
@@ -2,7 +2,7 @@
   Copyright(c) 2011-2016 Intel Corporation All rights reserved.
 
   Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions 
+  modification, are permitted provided that the following conditions
   are met:
     * Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.
@@ -62,10 +62,16 @@ int main(void)
        uint32_t lens[TEST_BUFS];
        unsigned int jobs, t;
        uint8_t *tmp_buf;
+       int ret;
 
        printf("multibinary_sha1 test, %d sets of %dx%d max: ", RANDOMS, TEST_BUFS, TEST_LEN);
 
-       posix_memalign((void *)&mgr, 16, sizeof(SHA1_HASH_CTX_MGR));
+       ret = posix_memalign((void *)&mgr, 16, sizeof(SHA1_HASH_CTX_MGR));
+       if ((ret != 0) || (mgr == NULL)) {
+               printf("posix_memalign failed test aborted\n");
+               return 1;
+       }
+
        sha1_ctx_mgr_init(mgr);
 
        srand(TEST_SEED);