[Mesa-dev] [PATCH] util: Fix warning of invalid return value

Chad Versace chad.versace at intel.com
Fri Apr 15 19:39:11 UTC 2016


_mesa_libgcrypt_init() returns NULL, but its return type is void.

Cc: Mark Janes <mark.a.janes at intel.com>
---
 src/util/mesa-sha1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/util/mesa-sha1.c b/src/util/mesa-sha1.c
index ca6b89b..b6a192f 100644
--- a/src/util/mesa-sha1.c
+++ b/src/util/mesa-sha1.c
@@ -180,7 +180,8 @@ _mesa_sha1_final(struct mesa_sha1 *ctx, unsigned char result[20])
 static void _mesa_libgcrypt_init(void)
 {
    if (!gcry_check_version(NULL))
-      return NULL;
+      return;
+
    gcry_control(GCRYCTL_DISABLE_SECMEM, 0);
    gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
 }
-- 
2.8.1



More information about the mesa-dev mailing list