Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1394010 > unrolled thread

[patch] rtlwifi: rtl818x: silence uninitialized variable warning

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2016-05-04 08:20 +0200
Last post2016-05-11 21:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [patch] rtlwifi: rtl818x: silence uninitialized variable warning Dan Carpenter <dan.carpenter@oracle.com> - 2016-05-04 08:20 +0200
    Re: rtlwifi: rtl818x: silence uninitialized variable warning Kalle Valo <kvalo@codeaurora.org> - 2016-05-11 21:00 +0200

#1394010 — [patch] rtlwifi: rtl818x: silence uninitialized variable warning

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-05-04 08:20 +0200
Subject[patch] rtlwifi: rtl818x: silence uninitialized variable warning
Message-ID<ruYka-6UF-11@gated-at.bofh.it>
What about if "rtlphy->pwrgroup_cnt" is 2?  In that case we would use an
uninitialized "chnlgroup" variable and probably crash.  Maybe that can't
happen for some reason which is not obvious but in that case this patch
is harmless.

Setting it to zero seems like a standard default in the surrounding code
so it's probably fine here as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/rf.c
index 78a81c1..9475aa2 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/rf.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/rf.c
@@ -208,8 +208,7 @@ static void _rtl92s_get_txpower_writeval_byregulatory(struct ieee80211_hw *hw,
 				 "Realtek regulatory, 40MHz, writeval = 0x%x\n",
 				 writeval);
 		} else {
-			if (rtlphy->pwrgroup_cnt == 1)
-				chnlgroup = 0;
+			chnlgroup = 0;
 
 			if (rtlphy->pwrgroup_cnt >= 3) {
 				if (chnl <= 3)

[toc] | [next] | [standalone]


#1399423 — Re: rtlwifi: rtl818x: silence uninitialized variable warning

FromKalle Valo <kvalo@codeaurora.org>
Date2016-05-11 21:00 +0200
SubjectRe: rtlwifi: rtl818x: silence uninitialized variable warning
Message-ID<rxHwu-5FD-11@gated-at.bofh.it>
In reply to#1394010
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> What about if "rtlphy->pwrgroup_cnt" is 2?  In that case we would use an
> uninitialized "chnlgroup" variable and probably crash.  Maybe that can't
> happen for some reason which is not obvious but in that case this patch
> is harmless.
> 
> Setting it to zero seems like a standard default in the surrounding code
> so it's probably fine here as well.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, 1 patch applied to wireless-drivers-next.git:

2f8514b8b036 rtlwifi: rtl818x: silence uninitialized variable warning

-- 
Sent by pwcli
https://patchwork.kernel.org/patch/9010761/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web