Commit 14b6cff
staging: rtl8723bs: avoid bogus gcc warning
gcc gets confused by some of the type casts and produces an
apparently senseless warning about an out-of-bound memcpy to
an unrelated array in the same structure:
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c: In function 'rtw_cfg80211_ap_set_encryption':
cc1: error: writing 8 bytes into a region of size 0 [-Werror=stringop-overflow=]
In file included from drivers/staging/rtl8723bs/include/drv_types.h:32,
from drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:10:
drivers/staging/rtl8723bs/include/rtw_security.h:98:15: note: at offset [184, 4264] into destination object 'dot11AuthAlgrthm' of size 4
98 | u32 dot11AuthAlgrthm; /* 802.11 auth, could be open, shared, 8021x and authswitch */
| ^~~~~~~~~~~~~~~~
cc1: error: writing 8 bytes into a region of size 0 [-Werror=stringop-overflow=]
drivers/staging/rtl8723bs/include/rtw_security.h:98:15: note: at offset [264, 4344] into destination object 'dot11AuthAlgrthm' of size 4
This is a known gcc bug, and the patch here is only a workaround,
but the approach of using a temporary variable to hold a pointer
to the key also improves readability in addition to avoiding the
warning, so overall this should still help.
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99673
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210422152648.2891996-1-arnd@kernel.org
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 6efb943 commit 14b6cff
2 files changed
Lines changed: 25 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
530 | 533 | | |
531 | 534 | | |
532 | 535 | | |
| |||
609 | 612 | | |
610 | 613 | | |
611 | 614 | | |
612 | | - | |
| 615 | + | |
613 | 616 | | |
614 | 617 | | |
615 | 618 | | |
| |||
622 | 625 | | |
623 | 626 | | |
624 | 627 | | |
625 | | - | |
| 628 | + | |
626 | 629 | | |
627 | 630 | | |
628 | 631 | | |
629 | | - | |
630 | | - | |
| 632 | + | |
| 633 | + | |
631 | 634 | | |
632 | 635 | | |
633 | 636 | | |
| |||
636 | 639 | | |
637 | 640 | | |
638 | 641 | | |
639 | | - | |
| 642 | + | |
640 | 643 | | |
641 | 644 | | |
642 | 645 | | |
| |||
713 | 716 | | |
714 | 717 | | |
715 | 718 | | |
716 | | - | |
| 719 | + | |
717 | 720 | | |
718 | 721 | | |
719 | 722 | | |
| |||
725 | 728 | | |
726 | 729 | | |
727 | 730 | | |
728 | | - | |
| 731 | + | |
729 | 732 | | |
730 | 733 | | |
731 | 734 | | |
732 | | - | |
733 | | - | |
| 735 | + | |
| 736 | + | |
734 | 737 | | |
735 | 738 | | |
736 | 739 | | |
| |||
739 | 742 | | |
740 | 743 | | |
741 | 744 | | |
742 | | - | |
| 745 | + | |
743 | 746 | | |
744 | 747 | | |
745 | 748 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2963 | 2963 | | |
2964 | 2964 | | |
2965 | 2965 | | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
2966 | 2969 | | |
2967 | 2970 | | |
2968 | 2971 | | |
| |||
3064 | 3067 | | |
3065 | 3068 | | |
3066 | 3069 | | |
3067 | | - | |
| 3070 | + | |
3068 | 3071 | | |
3069 | 3072 | | |
3070 | 3073 | | |
| |||
3073 | 3076 | | |
3074 | 3077 | | |
3075 | 3078 | | |
3076 | | - | |
| 3079 | + | |
3077 | 3080 | | |
3078 | 3081 | | |
3079 | 3082 | | |
3080 | | - | |
| 3083 | + | |
3081 | 3084 | | |
3082 | 3085 | | |
3083 | 3086 | | |
| |||
3086 | 3089 | | |
3087 | 3090 | | |
3088 | 3091 | | |
3089 | | - | |
| 3092 | + | |
3090 | 3093 | | |
3091 | 3094 | | |
3092 | 3095 | | |
| |||
3142 | 3145 | | |
3143 | 3146 | | |
3144 | 3147 | | |
3145 | | - | |
| 3148 | + | |
3146 | 3149 | | |
3147 | 3150 | | |
3148 | 3151 | | |
3149 | 3152 | | |
3150 | 3153 | | |
3151 | 3154 | | |
3152 | 3155 | | |
3153 | | - | |
| 3156 | + | |
3154 | 3157 | | |
3155 | 3158 | | |
3156 | 3159 | | |
3157 | | - | |
3158 | | - | |
| 3160 | + | |
| 3161 | + | |
3159 | 3162 | | |
3160 | 3163 | | |
3161 | 3164 | | |
3162 | 3165 | | |
3163 | 3166 | | |
3164 | 3167 | | |
3165 | | - | |
| 3168 | + | |
3166 | 3169 | | |
3167 | 3170 | | |
3168 | 3171 | | |
| |||
0 commit comments