diff mbox series

[v2,wireless-drivers-next] rtlwifi: rtl8723ae: Fix missing break in switch statement

Message ID 20190416151722.GA31598@embeddedor (mailing list archive)
State Accepted
Commit 84242b82d81c54e009a2aaa74d3d9eff70babf56
Delegated to: Kalle Valo
Headers show
Series [v2,wireless-drivers-next] rtlwifi: rtl8723ae: Fix missing break in switch statement | expand

Commit Message

Gustavo A. R. Silva April 16, 2019, 3:17 p.m. UTC
Add missing break statement in order to prevent the code from falling
through to case 0x1025, and erroneously setting rtlhal->oem_id to
RT_CID_819X_ACER when rtlefuse->eeprom_svid is equal to 0x10EC and
none of the cases in switch (rtlefuse->eeprom_smid) match.

This bug was found thanks to the ongoing efforts to enable
-Wimplicit-fallthrough.

Fixes: 238ad2ddf34b ("rtlwifi: rtl8723ae: Clean up the hardware info routine")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
Changes in v2:
 - Update tag from wireless-drivers to wireless-drivers-next

 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gustavo A. R. Silva April 24, 2019, 10:17 p.m. UTC | #1
Hi all,

Friendly ping:

Who can take this?

Thanks
--
Gustavo


On 4/16/19 10:17 AM, Gustavo A. R. Silva wrote:
> Add missing break statement in order to prevent the code from falling
> through to case 0x1025, and erroneously setting rtlhal->oem_id to
> RT_CID_819X_ACER when rtlefuse->eeprom_svid is equal to 0x10EC and
> none of the cases in switch (rtlefuse->eeprom_smid) match.
> 
> This bug was found thanks to the ongoing efforts to enable
> -Wimplicit-fallthrough.
> 
> Fixes: 238ad2ddf34b ("rtlwifi: rtl8723ae: Clean up the hardware info routine")
> Cc: stable@vger.kernel.org
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> Changes in v2:
>  - Update tag from wireless-drivers to wireless-drivers-next
> 
>  drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
> index 6bab162e1bb8..655460f61bbc 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
> @@ -1675,6 +1675,7 @@ static void _rtl8723e_read_adapter_info(struct ieee80211_hw *hw,
>  					rtlhal->oem_id = RT_CID_819X_LENOVO;
>  					break;
>  				}
> +				break;
>  			case 0x1025:
>  				rtlhal->oem_id = RT_CID_819X_ACER;
>  				break;
>
Kalle Valo April 25, 2019, 9:37 a.m. UTC | #2
"Gustavo A. R. Silva" <gustavo@embeddedor.com> writes:

> Hi all,
>
> Friendly ping:
>
> Who can take this?

It's in my queue.
Gustavo A. R. Silva April 25, 2019, 2:27 p.m. UTC | #3
On 4/25/19 4:37 AM, Kalle Valo wrote:
> "Gustavo A. R. Silva" <gustavo@embeddedor.com> writes:
> 
>> Hi all,
>>
>> Friendly ping:
>>
>> Who can take this?
> 
> It's in my queue.
> 

Awesome. :)

Thank you
--
Gustavo
Kalle Valo April 25, 2019, 4:56 p.m. UTC | #4
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> Add missing break statement in order to prevent the code from falling
> through to case 0x1025, and erroneously setting rtlhal->oem_id to
> RT_CID_819X_ACER when rtlefuse->eeprom_svid is equal to 0x10EC and
> none of the cases in switch (rtlefuse->eeprom_smid) match.
> 
> This bug was found thanks to the ongoing efforts to enable
> -Wimplicit-fallthrough.
> 
> Fixes: 238ad2ddf34b ("rtlwifi: rtl8723ae: Clean up the hardware info routine")
> Cc: stable@vger.kernel.org
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Patch applied to wireless-drivers-next.git, thanks.

84242b82d81c rtlwifi: rtl8723ae: Fix missing break in switch statement
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
index 6bab162e1bb8..655460f61bbc 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
@@ -1675,6 +1675,7 @@  static void _rtl8723e_read_adapter_info(struct ieee80211_hw *hw,
 					rtlhal->oem_id = RT_CID_819X_LENOVO;
 					break;
 				}
+				break;
 			case 0x1025:
 				rtlhal->oem_id = RT_CID_819X_ACER;
 				break;