linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Theodore Ts'o <tytso@mit.edu>, Li Xi <pkuelelixi@gmail.com>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	linux-ext4@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] ext4: checking for NULL instead of IS_ERR
Date: Wed, 6 Jan 2016 14:05:11 +0100	[thread overview]
Message-ID: <20160106130511.GA29528@quack.suse.cz> (raw)
In-Reply-To: <20160106100425.GG23185@mwanda>

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

  reply	other threads:[~2016-01-06 13:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06 10:04 [patch] ext4: checking for NULL instead of IS_ERR Dan Carpenter
2016-01-06 13:05 ` Jan Kara [this message]
2016-01-08 20:52 ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160106130511.GA29528@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=adilger.kernel@dilger.ca \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=pkuelelixi@gmail.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).