net: Initialize return value in gro_cells_receive
Subsystems (2)
The 'res' return value is uninitalized and may be returned with some random value. Initialize to NET_RX_DROP as the default return value.
net/core/gro_cells.c +1 -1
@@ -13,7 +13,7 @@ int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) {struct net_device *dev = skb->dev;struct gro_cell *cell; -int res; +int res =NET_RX_DROP ;rcu_read_lock ();if (unlikely (!(dev->flags &IFF_UP )))
Quoted 11 lines · Gregory Rose
The 'res' return value is uninitalized and may be returned with some random value. Initialize to
NET_RX_DROPas the default return value.Signed-off-by Greg Rose <[email protected]>net/core/gro_cells.c +0
-0
net/core/gro_cells.c int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) · line 19
Quoted 8 lines
net/core/gro_cells.c +1
-1@@ -13,7 +13,7 @@ int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) { struct net_device *dev = skb->dev; struct gro_cell *cell; - int res; + int res = NET_RX_DROP; rcu_read_lock(); if (unlikely(!(dev->flags & IFF_UP)))
I do not think this is needed.
Also, when/if sending a patch fixing a bug, we require a Fixes: tag.
Thanks.
Quoted 20 lines · Eric Dumazet
Quoted 17 lines · Gregory Rose
The 'res' return value is uninitalized and may be returned with some random value. Initialize to
NET_RX_DROPas the default return value.Signed-off-by Greg Rose <[email protected]>net/core/gro_cells.c +1
-1@@ -13,7 +13,7 @@ int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) { struct net_device *dev = skb->dev; struct gro_cell *cell; - int res; + int res = NET_RX_DROP;
Quoted 9 lines
net/core/gro_cells.c int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) · line 19
Quoted 2 lines
net/core/gro_cells.c +0
-0rcu_read_lock(); if (unlikely(!(dev->flags & IFF_UP)))I do not think this is needed.
Also, when/if sending a patch fixing a bug, we require a Fixes: tag.
Thanks.
If it's not needed then feel free to ignore it. It just looked like the unlikely case returns without setting the return value.
Thanks
- Greg
Thanks,
Quoted 28 lines · Gregory Rose
Quoted 25 lines · Eric Dumazet
Quoted 11 lines · Gregory Rose
The 'res' return value is uninitalized and may be returned with some random value. Initialize to
NET_RX_DROPas the default return value.Signed-off-by Greg Rose <[email protected]>net/core/gro_cells.c +0
-0net/core/gro_cells.c int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) · line 19
Quoted 8 lines
net/core/gro_cells.c +1
-1@@ -13,7 +13,7 @@ int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) { struct net_device *dev = skb->dev; struct gro_cell *cell; - int res; + int res = NET_RX_DROP; rcu_read_lock(); if (unlikely(!(dev->flags & IFF_UP)))I do not think this is needed.
Quoted 6 lines
Quoted 4 lines
Also, when/if sending a patch fixing a bug, we require a Fixes: tag.
Thanks.
If it's not needed then feel free to ignore it. It just looked like the unlikely case returns without setting the return value.
Can you elaborate ? I do not see this problem in current upstream code.
If a compiler gave you a warning, please give its version, thanks.
Quoted 33 lines · Eric Dumazet
Quoted 30 lines · Gregory Rose
Quoted 27 lines · Eric Dumazet
Quoted 11 lines · Gregory Rose
The 'res' return value is uninitalized and may be returned with some random value. Initialize to
NET_RX_DROPas the default return value.Signed-off-by Greg Rose <[email protected]>net/core/gro_cells.c +0
-0net/core/gro_cells.c int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) · line 19
Quoted 8 lines
net/core/gro_cells.c +1
-1@@ -13,7 +13,7 @@ int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) { struct net_device *dev = skb->dev; struct gro_cell *cell; - int res; + int res = NET_RX_DROP; rcu_read_lock(); if (unlikely(!(dev->flags & IFF_UP)))I do not think this is needed.
Also, when/if sending a patch fixing a bug, we require a Fixes: tag.
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
Thanks.
If it's not needed then feel free to ignore it. It just looked like the unlikely case returns without setting the return value.
Can you elaborate ? I do not see this problem in current upstream code.
If a compiler gave you a warning, please give its version, thanks.
No, it's my misreading of the code - it jumps to the drop that is in the middle of an if statement, sets res to NET_RX_DROP there and then jumps to the unlock label.
My apologies.
- Greg