]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fs/orangefs: Replace kzalloc + copy_from_user with memdup_user_nul
authorThorsten Blum <thorsten.blum@linux.dev>
Thu, 18 Sep 2025 15:08:10 +0000 (17:08 +0200)
committerMike Marshall <hubcap@omnibond.com>
Tue, 30 Sep 2025 14:23:24 +0000 (10:23 -0400)
commit11f6bce77e27e82015a0d044e6c1eec8b139831a
treecb9ca304f5b583ad4d39356fb93c760bf107bfdc
parent025e880759c279ec64d0f754fe65bf45961da864
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>
fs/orangefs/orangefs-debugfs.c