Thread (12 messages) 12 messages, 1 author, 2016-03-08

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

flat view
STALE3865d

From: David Decotigny <hidden>
Date: 2016-03-08 03:35:19
Subsystem: the rest · Maintainer: Linus Torvalds

Revision v4 of 4 in this series.

Revisions (4)
  1. v2 [diff vs current]
  2. v3 [diff vs current]
  3. v4 current
  4. v4 [diff vs current]
From: Maciej Żenczykowski <redacted>

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 <redacted>
Signed-off-by: David Decotigny <redacted>
---
 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;
-- 
2.7.0.rc3.207.g0ac5344
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help