Skip to content

Commit

Permalink
staging: rtl8723bs: os_dep: remove set but not used 'size'
Browse files Browse the repository at this point in the history
And also remove the NULL check before kfree() because kfree() can handle
NULL pointers correctly.

Fix the following gcc warning:

drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:157:6: warning:
variable ‘size’ set but not used [-Wunused-but-set-variable]
  u32 size = 0;
      ^~~~

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20200427032342.27211-3-yanaijie@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jason Yan authored and Greg Kroah-Hartman committed Apr 28, 2020
1 parent fc84701 commit 5899458
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,6 @@ static struct ieee80211_supported_band *rtw_spt_band_alloc(

static void rtw_spt_band_free(struct ieee80211_supported_band *spt_band)
{
u32 size = 0;

if (!spt_band)
return;

if (spt_band->band == NL80211_BAND_2GHZ)
{
size = sizeof(struct ieee80211_supported_band)
+ sizeof(struct ieee80211_channel)*RTW_2G_CHANNELS_NUM
+ sizeof(struct ieee80211_rate)*RTW_G_RATES_NUM;
}
kfree(spt_band);
}

Expand Down

0 comments on commit 5899458

Please sign in to comment.