Commit 11f6bce
fs/orangefs: Replace kzalloc + copy_from_user with memdup_user_nul
Replace kzalloc() followed by copy_from_user() with memdup_user_nul() to
simplify and improve orangefs_debug_write(). Allocate only 'count' bytes
instead of the maximum size ORANGEFS_MAX_DEBUG_STRING_LEN, and set 'buf'
to NULL to ensure kfree(buf) still works.
No functional changes intended.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>1 parent 025e880 commit 11f6bce
1 file changed
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
| 443 | + | |
| 444 | + | |
448 | 445 | | |
449 | | - | |
| 446 | + | |
450 | 447 | | |
| 448 | + | |
| 449 | + | |
451 | 450 | | |
452 | 451 | | |
453 | 452 | | |
| |||
0 commit comments