Commit 31720a2
orangefs: Fix kmemleak in orangefs_{kernel,client}_debug_init()
When insert and remove the orangefs module, there are memory leaked
as below:
unreferenced object 0xffff88816b0cc000 (size 2048):
comm "insmod", pid 783, jiffies 4294813439 (age 65.512s)
hex dump (first 32 bytes):
6e 6f 6e 65 0a 00 00 00 00 00 00 00 00 00 00 00 none............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<0000000031ab7788>] kmalloc_trace+0x27/0xa0
[<000000005b405fee>] orangefs_debugfs_init.cold+0xaf/0x17f
[<00000000e5a0085b>] 0xffffffffa02780f9
[<000000004232d9f7>] do_one_initcall+0x87/0x2a0
[<0000000054f22384>] do_init_module+0xdf/0x320
[<000000003263bdea>] load_module+0x2f98/0x3330
[<0000000052cd4153>] __do_sys_finit_module+0x113/0x1b0
[<00000000250ae02b>] do_syscall_64+0x35/0x80
[<00000000f11c03c7>] entry_SYSCALL_64_after_hwframe+0x46/0xb0
Use the golbal variable as the buffer rather than dynamic allocate to
slove the problem.
Signed-off-by: Zhang Xiaoxu <[email protected]>
Signed-off-by: Mike Marshall <[email protected]>1 parent 1f2c0e8 commit 31720a2
1 file changed
+3
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
| 197 | + | |
199 | 198 | | |
200 | 199 | | |
201 | 200 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | 201 | | |
207 | 202 | | |
208 | 203 | | |
| |||
213 | 208 | | |
214 | 209 | | |
215 | 210 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | 211 | | |
220 | 212 | | |
221 | 213 | | |
| |||
299 | 291 | | |
300 | 292 | | |
301 | 293 | | |
302 | | - | |
| 294 | + | |
303 | 295 | | |
304 | 296 | | |
305 | | - | |
306 | | - | |
| 297 | + | |
307 | 298 | | |
308 | 299 | | |
309 | 300 | | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | 301 | | |
315 | 302 | | |
316 | 303 | | |
| |||
324 | 311 | | |
325 | 312 | | |
326 | 313 | | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | 314 | | |
335 | 315 | | |
336 | 316 | | |
| |||
0 commit comments