Skip to contentSkip to conversation

Patch "net: tg3: avoid uninitialized variable warning" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message May 3, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

net: tg3: avoid uninitialized variable warning

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
net-tg3-avoid-uninitialized-variable-warning.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From e434e04110704eb91acfecbd0fb8ca8e2da9c29b Mon Sep 17 00:00:00 2001

From: Arnd Bergmann <[email protected]>
Date: Fri, 29 Jan 2016 12:39:15 +0100
Subject: net: tg3: avoid uninitialized variable warning

From: Arnd Bergmann <[email protected]>

commit e434e04110704eb91acfecbd0fb8ca8e2da9c29b upstream.

The tg3_set_eeprom() function correctly initializes the 'start' variable, but gcc generates a false warning:

drivers/net/ethernet/broadcom/tg3.c: In function 'tg3_set_eeprom':
drivers/net/ethernet/broadcom/tg3.c:12057:4: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized]

I have not come up with a way to restructure the code in a way that avoids the warning without making it less readable, so this adds an initialization for the declaration to shut up that warning.

---
 drivers/net/ethernet/broadcom/tg3.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/tg3.c +1 -1
@@ -12031,7 +12031,7 @@ static int tg3_set_eeprom(struct net_dev
 	int ret;
 	u32 offset, len, b_offset, odd_len;
 	u8 *buf;
-	__be32 start, end;
+	__be32 start = 0, end;
 
 	if (tg3_flag(tp, NO_NVRAM) ||
 	    eeprom->magic != TG3_EEPROM_MAGIC)

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch queue-4.4/net-tg3-avoid-uninitialized-variable-warning.patch queue-4.4/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch queue-4.4/drbd-avoid-redefinition-of-bits_per_page.patch