Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1735547 > unrolled thread

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

Started byAllen Pais <allen.lkml@gmail.com>
First post2017-09-20 08:20 +0200
Last post2017-09-20 08:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] fs:btrfs: return -ENOMEM on allocation failure. Allen Pais <allen.lkml@gmail.com> - 2017-09-20 08:20 +0200

#1735547 — [PATCH v2] fs:btrfs: return -ENOMEM on allocation failure.

FromAllen Pais <allen.lkml@gmail.com>
Date2017-09-20 08:20 +0200
Subject[PATCH v2] fs:btrfs: return -ENOMEM on allocation failure.
Message-ID<urGwy-7DX-3@gated-at.bofh.it>
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(-)

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;
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web