[Pkg-ofed-commits] [infinipath-psm] 08/11: Initialize variables

Ana Beatriz Guerrero López ana at moszumanska.debian.org
Sun Apr 3 20:04:11 UTC 2016


This is an automated email from the git hooks/post-receive script.

ana pushed a commit to branch master
in repository infinipath-psm.

commit 07ed87dfcf13dcab3bd2b78340972b0130c99f20
Author: Ana Guerrero López <ana at ekaia.org>
Date:   Thu Mar 31 23:17:11 2016 +0200

    Initialize variables
    
    This patch fixes the following -Werror=maybe-uninitialized errors:
    
    psm_diags.c:294:10: error: 'dst_p' may be used uninitialized in this function [-Werror=maybe-uninitialized]
           if (dst_p) psmi_free(dst_p);
              ^
    In file included from psm_user.h:54:0,
                     from psm_diags.c:35:
    psm_utils.h:156:23: error: 'src_p' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     #define psmi_free(sz) psmi_free_internal(sz)
                           ^
    psm_diags.c:290:11: note: 'src_p' was declared here
         void *src_p, *dst_p;
               ^
    If posix_memalign fails to return a value different than zero,
    the pointers are never initialized.
---
 psm_diags.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/psm_diags.c b/psm_diags.c
index b6fedd9..3e2df9d 100644
--- a/psm_diags.c
+++ b/psm_diags.c
@@ -287,7 +287,7 @@ memcpy_check_size (memcpy_fn_t fn, int *p, int *f, size_t n)
       return -1;
   }
   else {
-    void *src_p, *dst_p;
+    void *src_p = NULL, *dst_p = NULL;
     if (posix_memalign(&src_p, 64, size) != 0 ||
         posix_memalign(&dst_p, 64, size) != 0) {
       if (src_p) psmi_free(src_p);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/infinipath-psm.git



More information about the Pkg-ofed-commits mailing list