linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] ext4: checking for NULL instead of IS_ERR
@ 2016-01-06 10:04 Dan Carpenter
  2016-01-06 13:05 ` Jan Kara
  2016-01-08 20:52 ` Theodore Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-01-06 10:04 UTC (permalink / raw)
  To: Theodore Ts'o, Li Xi; +Cc: Andreas Dilger, linux-ext4, kernel-janitors

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 <dan.carpenter@oracle.com>

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 ?

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

* Re: [patch] ext4: checking for NULL instead of IS_ERR
  2016-01-06 10:04 [patch] ext4: checking for NULL instead of IS_ERR Dan Carpenter
@ 2016-01-06 13:05 ` Jan Kara
  2016-01-08 20:52 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2016-01-06 13:05 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Theodore Ts'o, Li Xi, Andreas Dilger, linux-ext4,
	kernel-janitors

On Wed 06-01-16 13:04:25, Dan Carpenter wrote:
> 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 <dan.carpenter@oracle.com>

Correct. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> 
> 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 ?
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

* Re: [patch] ext4: checking for NULL instead of IS_ERR
  2016-01-06 10:04 [patch] ext4: checking for NULL instead of IS_ERR Dan Carpenter
  2016-01-06 13:05 ` Jan Kara
@ 2016-01-08 20:52 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Ts'o @ 2016-01-08 20:52 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Li Xi, Andreas Dilger, linux-ext4, kernel-janitors

On Wed, Jan 06, 2016 at 01:04:25PM +0300, Dan Carpenter wrote:
> 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 <dan.carpenter@oracle.com>

Thanks for pointing this out.  I've folded this into the commit with
the bug.

					- Ted

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

end of thread, other threads:[~2016-01-08 20:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-06 10:04 [patch] ext4: checking for NULL instead of IS_ERR Dan Carpenter
2016-01-06 13:05 ` Jan Kara
2016-01-08 20:52 ` Theodore Ts'o

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).