From: Allen Pais Date: Wed, 20 Sep 2017 06:17:46 +0000 (+0530) Subject: btrfs: return -ENOMEM on allocation failure in btrfsic X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=3afb0c501414aa3c4a7cfea9ae1a0acfbf7be14f;p=openwrt%2Fstaging%2Fblogic.git btrfs: return -ENOMEM on allocation failure in btrfsic Forward the correct return value -ENOMEM from btrfsic_dev_state_alloc() too. Signed-off-by: Allen Pais Reviewed-by: Anand Jain Reviewed-by: David Sterba [ adjust changelog ] Signed-off-by: David Sterba --- diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index 7d5a9b51f0d7..9db1e7602dfc 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c @@ -2913,7 +2913,7 @@ int btrfsic_mount(struct btrfs_fs_info *fs_info, state = kvzalloc(sizeof(*state), GFP_KERNEL); if (!state) { pr_info("btrfs check-integrity: allocation failed!\n"); - return -1; + return -ENOMEM; } if (!btrfsic_is_initialized) { @@ -2945,7 +2945,7 @@ int btrfsic_mount(struct btrfs_fs_info *fs_info, if (NULL == ds) { pr_info("btrfs check-integrity: kmalloc() failed!\n"); mutex_unlock(&btrfsic_mutex); - return -1; + return -ENOMEM; } ds->bdev = device->bdev; ds->state = state;