* [PATCH] net: Initialize all members in skb_gro_remcsum_init()
@ 2015-02-18 10:38 Geert Uytterhoeven
2015-02-18 15:28 ` Tom Herbert
2015-02-20 20:50 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2015-02-18 10:38 UTC (permalink / raw)
To: David S. Miller, Tom Herbert; +Cc: netdev, linux-kernel, Geert Uytterhoeven
skb_gro_remcsum_init() initializes the gro_remcsum.delta member only,
leading to compiler warnings about a possibly uninitialized
gro_remcsum.offset member:
drivers/net/vxlan.c: In function ‘vxlan_gro_receive’:
drivers/net/vxlan.c:602: warning: ‘grc.offset’ may be used uninitialized in this function
net/ipv4/fou.c: In function ‘gue_gro_receive’:
net/ipv4/fou.c:262: warning: ‘grc.offset’ may be used uninitialized in this function
While these are harmless for now:
- skb_gro_remcsum_process() sets offset before changing delta,
- skb_gro_remcsum_cleanup() checks if delta is non-zero before
accessing offset,
it's safer to let the initialization function initialize all members.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
include/linux/netdevice.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5897b4ea5a3f9e0f..429d1790a27e85f3 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2342,6 +2342,7 @@ struct gro_remcsum {
static inline void skb_gro_remcsum_init(struct gro_remcsum *grc)
{
+ grc->offset = 0;
grc->delta = 0;
}
--
1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: Initialize all members in skb_gro_remcsum_init()
2015-02-18 10:38 [PATCH] net: Initialize all members in skb_gro_remcsum_init() Geert Uytterhoeven
@ 2015-02-18 15:28 ` Tom Herbert
2015-02-20 20:50 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Tom Herbert @ 2015-02-18 15:28 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: David S. Miller, Linux Netdev List, LKML
On Wed, Feb 18, 2015 at 2:38 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> skb_gro_remcsum_init() initializes the gro_remcsum.delta member only,
> leading to compiler warnings about a possibly uninitialized
> gro_remcsum.offset member:
>
> drivers/net/vxlan.c: In function ‘vxlan_gro_receive’:
> drivers/net/vxlan.c:602: warning: ‘grc.offset’ may be used uninitialized in this function
> net/ipv4/fou.c: In function ‘gue_gro_receive’:
> net/ipv4/fou.c:262: warning: ‘grc.offset’ may be used uninitialized in this function
>
> While these are harmless for now:
> - skb_gro_remcsum_process() sets offset before changing delta,
> - skb_gro_remcsum_cleanup() checks if delta is non-zero before
> accessing offset,
> it's safer to let the initialization function initialize all members.
>
Acked-by: Tom Herbert <therbert@google.com>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> include/linux/netdevice.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 5897b4ea5a3f9e0f..429d1790a27e85f3 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -2342,6 +2342,7 @@ struct gro_remcsum {
>
> static inline void skb_gro_remcsum_init(struct gro_remcsum *grc)
> {
> + grc->offset = 0;
> grc->delta = 0;
> }
>
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: Initialize all members in skb_gro_remcsum_init()
2015-02-18 10:38 [PATCH] net: Initialize all members in skb_gro_remcsum_init() Geert Uytterhoeven
2015-02-18 15:28 ` Tom Herbert
@ 2015-02-20 20:50 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-02-20 20:50 UTC (permalink / raw)
To: geert; +Cc: therbert, netdev, linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=iso-8859-7, Size: 1049 bytes --]
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Wed, 18 Feb 2015 11:38:06 +0100
> skb_gro_remcsum_init() initializes the gro_remcsum.delta member only,
> leading to compiler warnings about a possibly uninitialized
> gro_remcsum.offset member:
>
> drivers/net/vxlan.c: In function ¡vxlan_gro_receive¢:
> drivers/net/vxlan.c:602: warning: ¡grc.offset¢ may be used uninitialized in this function
> net/ipv4/fou.c: In function ¡gue_gro_receive¢:
> net/ipv4/fou.c:262: warning: ¡grc.offset¢ may be used uninitialized in this function
>
> While these are harmless for now:
> - skb_gro_remcsum_process() sets offset before changing delta,
> - skb_gro_remcsum_cleanup() checks if delta is non-zero before
> accessing offset,
> it's safer to let the initialization function initialize all members.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Applied, thank you.
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-02-20 20:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-18 10:38 [PATCH] net: Initialize all members in skb_gro_remcsum_init() Geert Uytterhoeven
2015-02-18 15:28 ` Tom Herbert
2015-02-20 20:50 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®