mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-14 01:31:02 +00:00
btrfs-progs: cleanup possible silent failure in btrfs-image
If the malloc above fails, the btrfs-image will exit directly without any error messages. Now just return the ENOMEM errno and let the caller prompt the error message. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
parent
aada050961
commit
cc1c1eab17
@ -2421,7 +2421,8 @@ static int update_disk_super_on_device(struct btrfs_fs_info *info,
|
||||
buf = malloc(BTRFS_SUPER_INFO_SIZE);
|
||||
if (!buf) {
|
||||
ret = -ENOMEM;
|
||||
exit(1);
|
||||
close(fp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
memcpy(buf, info->super_copy, BTRFS_SUPER_INFO_SIZE);
|
||||
|
Loading…
Reference in New Issue
Block a user