Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp120664rdb; Tue, 31 Oct 2023 02:36:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvA8Z9XIVvXKep8UnFWPa6c1moWfMLUf4VTqS4QdHninkhRPh7i0YCOr6O1umqIYnf0qL3 X-Received: by 2002:a05:6870:e998:b0:1e9:b82e:ba29 with SMTP id r24-20020a056870e99800b001e9b82eba29mr17572820oao.24.1698744970727; Tue, 31 Oct 2023 02:36:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698744970; cv=none; d=google.com; s=arc-20160816; b=n62Q1BtgPFmendbEZYgmXU450mkHnyqBZtDfxs4TBLSAUpmPq8qstZV4yGAn6aWoXh Pw5zYV855qyPjVB2nYsptS7k7seJLn5/uQaN81b0ngvuTkSCddBYeJeGxOPIcHmR1pFZ GAC6kT83lm5HN7RP37Kv5jpVpZkEmjjC1RuWZiUJFFn1I/G+TkY7G0wW8+7jn51mH1B5 PS2+ZULw/oGDNqLOMgQaP7DcJOifO1d2/IdsiZKvPciK3VsiMqIC0kqDi7k+ALEnUQ5S BMm5nUCFXxjfy+x+fnxLcMbjhOXHvp94SvOumVw2N7Z0rhdV5Qu8QWbyAdtAIXEYrUlQ UYYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Vj2v8nBbDraGwHkX+LYdJhIhk49M3jP/ZklYrATSXsM=; fh=2v2rVuwd+fRB1zQFyL5p8a8kRSh+6tew2E945D07c1c=; b=W/ABKtgtczy6d49TKEXPbfg0qqJYkeDmtEIGNgE1A0E/55C3k+weDUTIWVvacqbuLB ErUg4siByv2Q6XW+T0Y26C4lwRSxwfV3yyycyTBS0BR1QTddOEPV8pkmGJF8zRnRJYBX 8tHnGwC7Za5BEBOOHu/FayLOFvScOXiRSMnjDxHBUkts9q0bw8awXboR2kVi42d/95rj qQn8honhkjPlC4HoPWt/PodBiBTGtkxaVcktpliUPZ4WoyDf0XQtxXR1OGmHE7Dj1DW/ ECXvKZTliWvIy6KvOH+ziQPee7qscf8qwAM3FUoeR1H2DayYPLrtNApdRojD+8Jqn+LN +2wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id cb11-20020a056a02070b00b005b8f45e539asi804617pgb.454.2023.10.31.02.36.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 02:36:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7319F8077FF9; Tue, 31 Oct 2023 02:36:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343946AbjJaJgC (ORCPT + 99 others); Tue, 31 Oct 2023 05:36:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343942AbjJaJgB (ORCPT ); Tue, 31 Oct 2023 05:36:01 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8EC13B7; Tue, 31 Oct 2023 02:35:58 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 13A1FC15; Tue, 31 Oct 2023 02:36:40 -0700 (PDT) Received: from [10.1.34.45] (unknown [10.1.34.45]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BB5323F67D; Tue, 31 Oct 2023 02:35:56 -0700 (PDT) Message-ID: Date: Tue, 31 Oct 2023 09:35:54 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH next] dm delay: Fix missing error code in delay_ctr() Content-Language: en-US To: Harshit Mogalapalli , Alasdair Kergon , Mike Snitzer , dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org Cc: dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org, error27@gmail.com References: <20231031071000.374939-1-harshit.m.mogalapalli@oracle.com> From: Christian Loehle In-Reply-To: <20231031071000.374939-1-harshit.m.mogalapalli@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 31 Oct 2023 02:36:08 -0700 (PDT) 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 > --- > 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 Thanks!