[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190822080848.GF4451@kadam>
Date: Thu, 22 Aug 2019 11:08:48 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Colin Ian King <colin.king@...onical.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jerry Chuang <jerry-chuang@...ltek.com>,
John Whitmore <johnfwhitmore@...il.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: Added Realtek rtl8192u driver to staging - static analysis
report.
On Wed, Aug 21, 2019 at 07:18:39PM +0100, Colin Ian King wrote:
> Hi,
>
> Static analysis of linux-next picked up an issue with the following commit:
>
> commit 8fc8598e61f6f384f3eaf1d9b09500c12af47b37
> Author: Jerry Chuang <jerry-chuang@...ltek.com>
> Date: Tue Nov 3 07:17:11 2009 -0200
>
> Staging: Added Realtek rtl8192u driver to staging
>
> In drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c we have:
>
> CID 48331 (#1 of 1): Unused value (UNUSED_VALUE) assigned_pointer
>
> Assigning value from ieee->crypt[ieee->tx_keyidx] to crypt here, but
> that stored value is not used.
>
> 746 crypt = ieee->crypt[ieee->tx_keyidx];
> 747 if (encrypt)
> 748 beacon_buf->capability |=
> cpu_to_le16(WLAN_CAPABILITY_PRIVACY);
Earlir in the function we have:
695 crypt = ieee->crypt[ieee->tx_keyidx];
696
697 encrypt = ieee->host_encrypt && crypt && crypt->ops &&
698 ((0 == strcmp(crypt->ops->name, "WEP") || wpa_ie_len));
699 /* HT ralated element */
So the "crypt" assignment is dublicate and should definitely be removed.
The "if (encrypt) " check looks correct and it sort of matches what we
do in ieee80211_assoc_resp().
840 encrypt = crypt && crypt->ops;
841
842 if (encrypt)
843 assoc->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY);
844
So let's leave it as-is, just delete the crypt assignment. If you want,
you can send this patch and I can give you a Reviewed-by tag or if you
want I can send the patch and give you Reported-by credit.
regards,
dan carpenter
Powered by blists - more mailing lists