Skip to content

Commit b898ef6

Browse files
committed
rtlwifi: rtl8192cu: Remove uninitialized_var() usage
Using uninitialized_var() is dangerous as it papers over real bugs[1] (or can in the future), and suppresses unrelated compiler warnings (e.g. "unused variable"). If the compiler thinks it is uninitialized, either simply initialize the variable or make compiler changes. As a precursor to removing[2] this[3] macro[4], just initialize this variable to NULL, and avoid sending garbage by returning. [1] https://lore.kernel.org/lkml/[email protected]/ [2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/ [3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/ [4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/ Fixes: dc0313f ("rtlwifi: rtl8192cu: Add routine hw") Reviewed-by: Nick Desaulniers <[email protected]> Acked-by: Kalle Valo <[email protected]> Signed-off-by: Kees Cook <[email protected]>
1 parent e909ec1 commit b898ef6

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/wireless/realtek/rtlwifi/rtl8192cu

1 file changed

+2
-2
lines changed

drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ static void _rtl92cu_init_chipn_one_out_ep_priority(struct ieee80211_hw *hw,
592592
bool wmm_enable,
593593
u8 queue_sel)
594594
{
595-
u16 uninitialized_var(value);
595+
u16 value;
596596

597597
switch (queue_sel) {
598598
case TX_SELE_HQ:
@@ -606,7 +606,7 @@ static void _rtl92cu_init_chipn_one_out_ep_priority(struct ieee80211_hw *hw,
606606
break;
607607
default:
608608
WARN_ON(1); /* Shall not reach here! */
609-
break;
609+
return;
610610
}
611611
_rtl92c_init_chipn_reg_priority(hw, value, value, value, value,
612612
value, value);

0 commit comments

Comments
 (0)