Commit aff1270
ntb: reduce stack usage in idt_scan_mws
idt_scan_mws() puts a large fixed-size array on the stack and copies
it into a smaller dynamically allocated array at the end. On 32-bit
targets, the fixed size can easily exceed the warning limit for
possible stack overflow:
drivers/ntb/hw/idt/ntb_hw_idt.c:1041:27: error: stack frame size (1032) exceeds limit (1024) in 'idt_scan_mws' [-Werror,-Wframe-larger-than]
Change it to instead just always use dynamic allocation for the
array from the start. It's too big for the stack, but not actually
all that much for a permanent allocation.
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Arnd Bergmann <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
Reviewed-by: Damien Le Moal <[email protected]>
Signed-off-by: Jon Mason <[email protected]>1 parent fd5625f commit aff1270
1 file changed
+7
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1041 | 1041 | | |
1042 | 1042 | | |
1043 | 1043 | | |
1044 | | - | |
| 1044 | + | |
1045 | 1045 | | |
1046 | 1046 | | |
1047 | 1047 | | |
1048 | 1048 | | |
1049 | 1049 | | |
1050 | 1050 | | |
1051 | 1051 | | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1052 | 1057 | | |
1053 | 1058 | | |
1054 | 1059 | | |
| |||
1103 | 1108 | | |
1104 | 1109 | | |
1105 | 1110 | | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
| 1111 | + | |
1116 | 1112 | | |
1117 | 1113 | | |
1118 | 1114 | | |
| |||
0 commit comments