mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Loehle <christian.loehle@arm.com>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>,
	Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>,
	dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Cc: dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org,
	error27@gmail.com
Subject: Re: [PATCH next] dm delay: Fix missing error code in delay_ctr()
Date: Tue, 31 Oct 2023 09:35:54 +0000	[thread overview]
Message-ID: <b50c2963-8eae-452f-98c6-03293bcca1a2@arm.com> (raw)
In-Reply-To: <20231031071000.374939-1-harshit.m.mogalapalli@oracle.com>

On 31/10/2023 07:10, Harshit Mogalapalli wrote:
> When worker thread allocation fails, return error instead of
> zero(success).
> 
> Also when kthread_create fails it returns ERR pointers and not NULL, so
> fix that as well.
> 
> Fixes: c1fce71d29b2 ("dm delay: for short delays, use kthread instead of timers and wq")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
> Smatch complained about the missing error code.
> This patch is only compile tested.
> ---
>  drivers/md/dm-delay.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c
> index 3d91804923eb..efd510984e25 100644
> --- a/drivers/md/dm-delay.c
> +++ b/drivers/md/dm-delay.c
> @@ -280,8 +280,10 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)
>  		 */
>  		dc->worker = kthread_create(&flush_worker_fn, dc,
>  					    "dm-delay-flush-worker");
> -		if (!dc->worker)
> +		if (IS_ERR(dc->worker)) {
> +			ret = PTR_ERR(dc->worker);
>  			goto bad;
> +		}
>  	} else {
>  		timer_setup(&dc->delay_timer, handle_delayed_timer, 0);
>  		INIT_WORK(&dc->flush_expired_bios, flush_expired_bios);
Reviewed-by: Christian Loehle <christian.loehle@arm.com>

Thanks!

      reply	other threads:[~2023-10-31  9:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-31  7:10 Harshit Mogalapalli
2023-10-31  9:35 ` Christian Loehle [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=b50c2963-8eae-452f-98c6-03293bcca1a2@arm.com \
    --to=christian.loehle@arm.com \
    --cc=agk@redhat.com \
    --cc=dan.carpenter@linaro.org \
    --cc=dm-devel@lists.linux.dev \
    --cc=error27@gmail.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=snitzer@kernel.org \
    /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®