Skip to contentSkip to conversation

ext4: checking for NULL instead of IS_ERR

PATCH In review Dan Carpenter 3 participants 3 messages Jan 6, 2016 – Jan 8, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: checking for NULL instead of IS_ERR

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

Fixes 76481d7a60a4 ('ext4: add project quota support')
fs/ext4/super.c +2 -2
index 50b2207..103a7a3 100644
@@ -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 ?
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dan Carpenter

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

Fixes 76481d7a60a4 ('ext4: add project quota support')

Correct. You can add:

Honza

Quoted 20 lines
fs/ext4/super.c +2 -3
index 50b2207..103a7a3 100644
@@ -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 ?
--

To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR