Re: [PATCH] net: dsa: mv88e6xxx: add default case to switch

2017-05-12 Thread David Miller
From: "Gustavo A. R. Silva" 
Date: Thu, 11 May 2017 22:11:29 -0500

> Add default case to switch in order to avoid any chance of using an
> uninitialized variable _low_, in case s->type does not match any of
> the listed case values.
> 
> Addresses-Coverity-ID: 1398130
> Suggested-by: Andrew Lunn 
> Signed-off-by: Gustavo A. R. Silva 

Applied, thanks.


Re: [PATCH] net: dsa: mv88e6xxx: add default case to switch

2017-05-12 Thread David Miller
From: "Gustavo A. R. Silva" 
Date: Thu, 11 May 2017 22:11:29 -0500

> Add default case to switch in order to avoid any chance of using an
> uninitialized variable _low_, in case s->type does not match any of
> the listed case values.
> 
> Addresses-Coverity-ID: 1398130
> Suggested-by: Andrew Lunn 
> Signed-off-by: Gustavo A. R. Silva 

Applied, thanks.


[PATCH] net: dsa: mv88e6xxx: add default case to switch

2017-05-11 Thread Gustavo A. R. Silva
Add default case to switch in order to avoid any chance of using an
uninitialized variable _low_, in case s->type does not match any of
the listed case values.

Addresses-Coverity-ID: 1398130
Suggested-by: Andrew Lunn 
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/net/dsa/mv88e6xxx/chip.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 03dc886..d39e210 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -879,6 +879,9 @@ static uint64_t _mv88e6xxx_get_ethtool_stat(struct 
mv88e6xxx_chip *chip,
mv88e6xxx_g1_stats_read(chip, reg, );
if (s->sizeof_stat == 8)
mv88e6xxx_g1_stats_read(chip, reg + 1, );
+   break;
+   default:
+   return UINT64_MAX;
}
value = (((u64)high) << 16) | low;
return value;
-- 
2.5.0



[PATCH] net: dsa: mv88e6xxx: add default case to switch

2017-05-11 Thread Gustavo A. R. Silva
Add default case to switch in order to avoid any chance of using an
uninitialized variable _low_, in case s->type does not match any of
the listed case values.

Addresses-Coverity-ID: 1398130
Suggested-by: Andrew Lunn 
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/net/dsa/mv88e6xxx/chip.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 03dc886..d39e210 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -879,6 +879,9 @@ static uint64_t _mv88e6xxx_get_ethtool_stat(struct 
mv88e6xxx_chip *chip,
mv88e6xxx_g1_stats_read(chip, reg, );
if (s->sizeof_stat == 8)
mv88e6xxx_g1_stats_read(chip, reg + 1, );
+   break;
+   default:
+   return UINT64_MAX;
}
value = (((u64)high) << 16) | low;
return value;
-- 
2.5.0