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