Skip to content

Commit b091f7f

Browse files
Waiman-Longkdave
authored andcommitted
btrfs: use kfree() in btrfs_ioctl_get_subvol_info()
In btrfs_ioctl_get_subvol_info(), there is a classic case where kzalloc() was incorrectly paired with kzfree(). According to David Sterba, there isn't any sensitive information in the subvol_info that needs to be cleared before freeing. So kzfree() isn't really needed, use kfree() instead. Signed-off-by: Waiman Long <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 5dbb75e commit b091f7f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2692,7 +2692,7 @@ static int btrfs_ioctl_get_subvol_info(struct file *file, void __user *argp)
26922692
btrfs_put_root(root);
26932693
out_free:
26942694
btrfs_free_path(path);
2695-
kzfree(subvol_info);
2695+
kfree(subvol_info);
26962696
return ret;
26972697
}
26982698

0 commit comments

Comments
 (0)