Prevent segfault if memory allocation fails for sargs in get_df
(cmds-filesystem.c).
Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
sargs = malloc(sizeof(struct btrfs_ioctl_space_args) +
(count * sizeof(struct btrfs_ioctl_space_info)));
if (!sargs)
- ret = -ENOMEM;
+ return -ENOMEM;
sargs->space_slots = count;
sargs->total_spaces = 0;