]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/crypto/isa-l/isa-l_crypto/sha512_mb/sha512_mb_test.c
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / crypto / isa-l / isa-l_crypto / sha512_mb / sha512_mb_test.c
index 747de43bb5da9efc733f079ab3a907cb5e5fc98a..a84e7af3e7a1a4012206b1d2f45efdaae2a5c0e7 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.
@@ -124,8 +124,14 @@ int main(void)
        SHA512_HASH_CTX ctxpool[NUM_JOBS], *ctx = NULL;
        uint32_t i, j, k, t, checked = 0;
        uint64_t *good;
+       int ret;
+
+       ret = posix_memalign((void *)&mgr, 16, sizeof(SHA512_HASH_CTX_MGR));
+       if ((ret != 0) || (mgr == NULL)) {
+               printf("posix_memalign failed test aborted\n");
+               return 1;
+       }
 
-       posix_memalign((void *)&mgr, 16, sizeof(SHA512_HASH_CTX_MGR));
        sha512_ctx_mgr_init(mgr);
 
        // Init contexts before first use