Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3afb0c50 authored by Allen Pais's avatar Allen Pais Committed by David Sterba
Browse files

btrfs: return -ENOMEM on allocation failure in btrfsic



Forward the correct return value -ENOMEM from btrfsic_dev_state_alloc()
too.

Signed-off-by: default avatarAllen Pais <allen.lkml@gmail.com>
Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
[ adjust changelog ]
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 6939f667
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -2913,7 +2913,7 @@ int btrfsic_mount(struct btrfs_fs_info *fs_info,
	state = kvzalloc(sizeof(*state), GFP_KERNEL);
	state = kvzalloc(sizeof(*state), GFP_KERNEL);
	if (!state) {
	if (!state) {
		pr_info("btrfs check-integrity: allocation failed!\n");
		pr_info("btrfs check-integrity: allocation failed!\n");
		return -1;
		return -ENOMEM;
	}
	}


	if (!btrfsic_is_initialized) {
	if (!btrfsic_is_initialized) {
@@ -2945,7 +2945,7 @@ int btrfsic_mount(struct btrfs_fs_info *fs_info,
		if (NULL == ds) {
		if (NULL == ds) {
			pr_info("btrfs check-integrity: kmalloc() failed!\n");
			pr_info("btrfs check-integrity: kmalloc() failed!\n");
			mutex_unlock(&btrfsic_mutex);
			mutex_unlock(&btrfsic_mutex);
			return -1;
			return -ENOMEM;
		}
		}
		ds->bdev = device->bdev;
		ds->bdev = device->bdev;
		ds->state = state;
		ds->state = state;