mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yu Kuai <yukuai1@huaweicloud.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Song Liu <song@kernel.org>, Coly Li <colyli@kernel.org>,
	Mike Snitzer <snitzer@kernel.org>,
	linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org,
	"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH next] md/md-linear: Fix a NULL vs IS_ERR() bug in linear_add()
Date: Wed, 15 Jan 2025 15:31:52 +0800	[thread overview]
Message-ID: <41e896f6-c71b-48c3-8944-eba3dba235cc@huaweicloud.com> (raw)
In-Reply-To: <add654be-759f-4b2d-93ba-a3726dae380c@stanley.mountain>

在 2025/01/15 14:53, Dan Carpenter 写道:
> The linear_conf() returns error pointers, it doesn't return NULL.  Update
> the error checking to match.
> 
> Fixes: 127186cfb184 ("md: reintroduce md-linear")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>   drivers/md/md-linear.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
LGTM
Reviewed-by: Yu Kuai <yukuai3@huawei.com>

> diff --git a/drivers/md/md-linear.c b/drivers/md/md-linear.c
> index 53bc3fda9edb..a382929ce7ba 100644
> --- a/drivers/md/md-linear.c
> +++ b/drivers/md/md-linear.c
> @@ -204,8 +204,8 @@ static int linear_add(struct mddev *mddev, struct md_rdev *rdev)
>   	rdev->saved_raid_disk = -1;
>   
>   	newconf = linear_conf(mddev, mddev->raid_disks + 1);
> -	if (!newconf)
> -		return -ENOMEM;
> +	if (IS_ERR(newconf))
> +		return PTR_ERR(newconf);
>   
>   	/* newconf->raid_disks already keeps a copy of * the increased
>   	 * value of mddev->raid_disks, WARN_ONCE() is just used to make
> 


      reply	other threads:[~2025-01-15  7:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-15  6:53 Dan Carpenter
2025-01-15  7:31 ` Yu Kuai [this message]

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=41e896f6-c71b-48c3-8944-eba3dba235cc@huaweicloud.com \
    --to=yukuai1@huaweicloud.com \
    --cc=colyli@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=snitzer@kernel.org \
    --cc=song@kernel.org \
    --cc=yukuai3@huawei.com \
    /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

all inboxes | Powered by JetHome®