[ethtool] 14/20: test-common.c: fix test_realloc(NULL, ...)

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Mon Mar 14 11:37:16 UTC 2016


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

benh pushed a commit to branch master
in repository ethtool.

commit 685adc7b77deb29082d054dd8c42e1d69b05cc59
Author: Maciej Żenczykowski <maze at google.com>
Date:   Fri Mar 11 09:58:19 2016 -0800

    test-common.c: fix test_realloc(NULL, ...)
    
    This fixes:
      test-common.c: In function 'test_realloc':
      test-common.c:109:8: error: 'block' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        block = realloc(block, sizeof(*block) + size);
              ^
    
    Signed-off-by: Maciej Żenczykowski <maze at google.com>
    Signed-off-by: David Decotigny <decot at googlers.com>
    Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
 test-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test-common.c b/test-common.c
index adc3cd4..cd63d1d 100644
--- a/test-common.c
+++ b/test-common.c
@@ -100,7 +100,7 @@ void test_free(void *ptr)
 
 void *test_realloc(void *ptr, size_t size)
 {
-	struct list_head *block;
+	struct list_head *block = NULL;
 
 	if (ptr) {
 		block = (struct list_head *)ptr - 1;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/ethtool.git



More information about the Kernel-svn-changes mailing list