All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fscache: Fix a NULL vs IS_ERR() bug in fscache_alloc_volume()
@ 2021-12-03  9:56 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-12-03  9:56 UTC (permalink / raw)
  To: David Howells; +Cc: linux-cachefs, kernel-janitors

The fscache_lookup_cache() function does not return NULL, it returns
error pointers.

Fixes: 27beaec4d546 ("fscache: Implement volume registration")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/fscache/volume.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fscache/volume.c b/fs/fscache/volume.c
index 4d0c2d43d54f..10f741c2072f 100644
--- a/fs/fscache/volume.c
+++ b/fs/fscache/volume.c
@@ -208,7 +208,7 @@ static struct fscache_volume *fscache_alloc_volume(const char *volume_key,
 	char *key;
 
 	cache = fscache_lookup_cache(cache_name, false);
-	if (!cache)
+	if (IS_ERR(cache))
 		return NULL;
 
 	volume = kzalloc(sizeof(*volume), GFP_KERNEL);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-03  9:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-03  9:56 [PATCH] fscache: Fix a NULL vs IS_ERR() bug in fscache_alloc_volume() Dan Carpenter

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.