All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] Btrfs: tests: checking for NULL instead of IS_ERR()
@ 2015-11-10  9:10 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2015-11-10  9:10 UTC (permalink / raw)
  To: Chris Mason; +Cc: Josef Bacik, David Sterba, linux-btrfs, kernel-janitors

btrfs_alloc_dummy_root() return an error pointer on failure, it never
returns NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/btrfs/tests/free-space-tests.c b/fs/btrfs/tests/free-space-tests.c
index c8c3d70..8b72b00 100644
--- a/fs/btrfs/tests/free-space-tests.c
+++ b/fs/btrfs/tests/free-space-tests.c
@@ -898,8 +898,10 @@ int btrfs_test_free_space_cache(void)
 	}
 
 	root = btrfs_alloc_dummy_root();
-	if (!root)
+	if (IS_ERR(root)) {
+		ret = PTR_ERR(root);
 		goto out;
+	}
 
 	root->fs_info = btrfs_alloc_dummy_fs_info();
 	if (!root->fs_info)

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

* [patch] Btrfs: tests: checking for NULL instead of IS_ERR()
@ 2015-11-10  9:10 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2015-11-10  9:10 UTC (permalink / raw)
  To: Chris Mason; +Cc: Josef Bacik, David Sterba, linux-btrfs, kernel-janitors

btrfs_alloc_dummy_root() return an error pointer on failure, it never
returns NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/btrfs/tests/free-space-tests.c b/fs/btrfs/tests/free-space-tests.c
index c8c3d70..8b72b00 100644
--- a/fs/btrfs/tests/free-space-tests.c
+++ b/fs/btrfs/tests/free-space-tests.c
@@ -898,8 +898,10 @@ int btrfs_test_free_space_cache(void)
 	}
 
 	root = btrfs_alloc_dummy_root();
-	if (!root)
+	if (IS_ERR(root)) {
+		ret = PTR_ERR(root);
 		goto out;
+	}
 
 	root->fs_info = btrfs_alloc_dummy_fs_info();
 	if (!root->fs_info)

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

* Re: [patch] Btrfs: tests: checking for NULL instead of IS_ERR()
  2015-11-10  9:10 ` Dan Carpenter
@ 2015-11-10  9:43   ` David Sterba
  -1 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2015-11-10  9:43 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Chris Mason, Josef Bacik, David Sterba, linux-btrfs, kernel-janitors

On Tue, Nov 10, 2015 at 12:10:03PM +0300, Dan Carpenter wrote:
> btrfs_alloc_dummy_root() return an error pointer on failure, it never
> returns NULL.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: David Sterba <dsterba@suse.com>

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

* Re: [patch] Btrfs: tests: checking for NULL instead of IS_ERR()
@ 2015-11-10  9:43   ` David Sterba
  0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2015-11-10  9:43 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Chris Mason, Josef Bacik, David Sterba, linux-btrfs, kernel-janitors

On Tue, Nov 10, 2015 at 12:10:03PM +0300, Dan Carpenter wrote:
> btrfs_alloc_dummy_root() return an error pointer on failure, it never
> returns NULL.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: David Sterba <dsterba@suse.com>

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

end of thread, other threads:[~2015-11-10  9:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-10  9:10 [patch] Btrfs: tests: checking for NULL instead of IS_ERR() Dan Carpenter
2015-11-10  9:10 ` Dan Carpenter
2015-11-10  9:43 ` David Sterba
2015-11-10  9:43   ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.