Commit 28e367a
objtool/klp: fix mkstemp() failure with long paths
The elf_create_file() function fails with EINVAL when the build directory
path is long enough to truncate the "XXXXXX" suffix in the 256-byte
tmp_name buffer.
Simplify the code to remove the unnecessary dirname()/basename() split
and concatenation. Instead, allocate the exact number of bytes needed for
the path.
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Link: https://patch.msgid.link/20260310203751.1479229-3-joe.lawrence@redhat.com
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>1 parent 2f2600d commit 28e367a
1 file changed
Lines changed: 3 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
1189 | 1188 | | |
1190 | 1189 | | |
1191 | 1190 | | |
1192 | | - | |
| 1191 | + | |
1193 | 1192 | | |
1194 | 1193 | | |
1195 | 1194 | | |
| |||
1203 | 1202 | | |
1204 | 1203 | | |
1205 | 1204 | | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
1215 | | - | |
1216 | | - | |
1217 | | - | |
1218 | | - | |
1219 | | - | |
1220 | | - | |
1221 | | - | |
1222 | | - | |
| 1205 | + | |
1223 | 1206 | | |
1224 | 1207 | | |
1225 | 1208 | | |
1226 | 1209 | | |
1227 | 1210 | | |
1228 | | - | |
| 1211 | + | |
1229 | 1212 | | |
1230 | 1213 | | |
1231 | 1214 | | |
| |||
0 commit comments