]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: convert ioctl handlers to AUTO_KFREE
authorDavid Sterba <dsterba@suse.com>
Tue, 14 Apr 2026 21:12:31 +0000 (23:12 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 8 Jun 2026 13:53:28 +0000 (15:53 +0200)
commitb1db292ee340750f109aa7486b24ae2bd6348af5
tree21b4458b9fcec36181427700d10685e48e5a5a2a
parent37f1f51fba1a4320149b1ea3b21d254d4b221b0a
btrfs: convert ioctl handlers to AUTO_KFREE

Many ioctl handlers are suitable for the AUTO_KFREE conversions as the
data are temporary and short lived. The conversions are trivial or the
collateral changes are straightforward.

A kfree() preceding mnt_drop_write_file() is slightly more efficient but
in the reverse order (i.e. the automatic kfree) does not cause any
significant change as the write drop does only a few simple operations.

Note: __free() handles also error pointers, so this is safe for the
memdup_user() errors too.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c