Thread (2 messages) 2 messages, 2 authors, 2012-09-20

[PATCH] md/bitmap:Don't use IS_ERR to judge alloc_page().

flat view
STALE5132d

From: Jianpeng Ma <hidden>
Date: 2012-09-15 02:43:00
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Jianpeng Ma <redacted>
---
 drivers/md/bitmap.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 94e7f6b..f03ad11 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -476,11 +476,8 @@ static int bitmap_new_disk_sb(struct bitmap *bitmap)
 	int err = -EINVAL;
 
 	bitmap->storage.sb_page = alloc_page(GFP_KERNEL);
-	if (IS_ERR(bitmap->storage.sb_page)) {
-		err = PTR_ERR(bitmap->storage.sb_page);
-		bitmap->storage.sb_page = NULL;
-		return err;
-	}
+	if (bitmap->storage.sb_page == NULL)
+		return -ENOMEM;
 	bitmap->storage.sb_page->index = 0;
 
 	sb = kmap_atomic(bitmap->storage.sb_page);
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help