Thread (3 messages) 3 messages, 3 authors, 2016-01-08
STALE3852d

[patch] ext4: checking for NULL instead of IS_ERR

From: Dan Carpenter <hidden>
Date: 2016-01-06 10:04:25
Also in: kernel-janitors
Subsystem: ext4 file system, filesystems (vfs and infrastructure), the rest · Maintainers: "Theodore Ts'o", Alexander Viro, Christian Brauner, Linus Torvalds

The dqget() function returns error pointers on error, it doesn't return
NULL.

Fixes: 76481d7a60a4 ('ext4: add project quota support')
Signed-off-by: Dan Carpenter <redacted>
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 50b2207..103a7a3 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4844,8 +4844,8 @@ static int ext4_statfs_project(struct super_block *sb,
 
 	qid = make_kqid_projid(projid);
 	dquot = dqget(sb, qid);
-	if (!dquot)
-		return -ESRCH;
+	if (IS_ERR(dquot))
+		return PTR_ERR(dquot);
 	spin_lock(&dq_data_lock);
 
 	limit = (dquot->dq_dqb.dqb_bsoftlimit ?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help