Search Linux Wireless

Re: [mac80211-next:master 3/5] net//wireless/wext-compat.c:1351:9: warning: function returns address of local variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2018-01-22 at 13:00 +0000, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.gi
> t master
> head:   076dc671ee9fa374e77c3d05925dafb75b23a74c
> commit: c179e91512cab01e83be35a60eaeda0f170a9101 [3/5] cfg80211: wext: don't
> use static struct
> config: x86_64-randconfig-x016-01221834 (attached as .config)
> compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
> reproduce:
>         git checkout c179e91512cab01e83be35a60eaeda0f170a9101
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> All warnings (new ones prefixed by >>):
> 
>    net//wireless/wext-compat.c: In function 'cfg80211_wireless_stats':
> >> net//wireless/wext-compat.c:1351:9: warning: function returns address of
> local variable [-Wreturn-local-addr]
>      return &wstats;
>             ^~~~~~~
> 

Hi Johannes,

In commit c179e9151, you remove 'static' from struct, but function return the
address of local variable as kbuild robot mentioned. It is a problem, but
my prior experiment looks fine. Hence, I check the callers of get_wireless_stats(),
and found they use the address that points to stack immediately, so content of
stack wasn't broken luckily.

So, please recall the 'static' of 'struct iw_statistics wstats'.
Thanks
PK





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux