linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] md/bitmap:Don't use IS_ERR to judge alloc_page().
@ 2012-09-15  2:43 Jianpeng Ma
  2012-09-20  2:54 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Jianpeng Ma @ 2012-09-15  2:43 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-raid

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-20  2:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-15  2:43 [PATCH] md/bitmap:Don't use IS_ERR to judge alloc_page() Jianpeng Ma
2012-09-20  2:54 ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).