diff mbox

[ethtool,v4,06/11] test-common.c: fix test_realloc(NULL, ...)

Message ID 1457408102-46662-7-git-send-email-ddecotig@gmail.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

david decotigny March 8, 2016, 3:34 a.m. UTC
From: Maciej Żenczykowski <maze@google.com>

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@google.com>
Signed-off-by: David Decotigny <decot@googlers.com>
---
 test-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

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;