[v2] fs:btrfs: return -ENOMEM on allocation failure.
diff mbox

Message ID 1505888266-23526-1-git-send-email-allen.lkml@gmail.com
State New
Headers show

Commit Message

Allen Sept. 20, 2017, 6:17 a.m. UTC
v2: return -ENOMEM from btrfsic_dev_state_alloc() too.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 fs/btrfs/check-integrity.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Anand Jain Sept. 20, 2017, 12:48 p.m. UTC | #1
On 09/20/2017 02:17 PM, Allen Pais wrote:
> v2: return -ENOMEM from btrfsic_dev_state_alloc() too.
> 
> Signed-off-by: Allen Pais <allen.lkml@gmail.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

> ---
>   fs/btrfs/check-integrity.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c
> index 7d5a9b5..9db1e76 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;
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c
index 7d5a9b5..9db1e76 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;