]> www.infradead.org Git - users/hch/block.git/commitdiff
btrfs: use kfree() in btrfs_ioctl_get_subvol_info()
authorWaiman Long <longman@redhat.com>
Tue, 16 Jun 2020 15:31:59 +0000 (11:31 -0400)
committerDavid Sterba <dsterba@suse.com>
Tue, 16 Jun 2020 17:24:03 +0000 (19:24 +0200)
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 <longman@redhat.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c

index 168deb8ef68aa36cc8fe886ffbc2daa0bf9df46a..e8f7c5f008944035b746af003b61e4ed543374df 100644 (file)
@@ -2692,7 +2692,7 @@ out:
        btrfs_put_root(root);
 out_free:
        btrfs_free_path(path);
-       kzfree(subvol_info);
+       kfree(subvol_info);
        return ret;
 }