Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp66150rdb; Tue, 31 Oct 2023 00:11:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEX6mPFVAHAN0h/ZQtPaxPi1QC+TrVxmNJ8OHZeBV6+WgPLUaO5dL5W7bOBuiez5Piahwvn X-Received: by 2002:a17:902:d2cf:b0:1c9:dba6:417a with SMTP id n15-20020a170902d2cf00b001c9dba6417amr2374536plc.9.1698736267535; Tue, 31 Oct 2023 00:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698736267; cv=none; d=google.com; s=arc-20160816; b=HZKjkxMzMguPCw/r7FW1hqqn1U1HQCanawQ57f/aJP4sVzgXd9/L3b/DKUX9HyF1mJ rFLzn5t02W2fLJLgrtd5zMXD76D9FqbUfCHFQUJQo1KBDimz1zRTYma8tgyb2/MvI8sX RushbbhoWVNrlKFOGfShSJ95X67suJ0fVSHCFi2NPgr0KqhgAGFirSKba7h+XZibsuO1 0w8F+U9bZtroWQrlfB0tZK/iNHsAateEGladxBixdCI3Av+kpw5sKslVsT8H4deZqcNi 76lLdyN8bZdohVL0zqSKhtlcm8n88D0SHYnXvOoFmhhKwQXiPnv47oT1GrKVbP2rJnIY ZQOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=aFlek+gaXhKJbUVTWsJQV470BEu2g6P29DQzCjLhqfc=; fh=LsPQE00mpb0JBkbQfP/h6MeGlP19wEuIYXf9/IrmKeQ=; b=yFY1uITmXRh/V7rfZex0/p+/bNpk8oC64aLSntQHeM9rzqPn4qunkBBxat2dbUY1MR PPrjALMOnCfNxOu/f8hxKFElkUEEfgQfMHLFwoJHVz4b7WFtHBp91xLvWN/lvcO/JqWi wBhSYILgJp2NMow5g31zf+mn/vUZmjySZGnc+fV6AC3zHLgBXryhy2wOIddNA/vUkhvN QZL6tXAakvwjJ4P0SujLisDS6IXKMBa/7QWQk27WPOq2QvPIFUwwTO9aofndsClAbY9P 3B6j15uFCcHhm+MqN1916SbSyn3SimRECqYIcM0sC3xhfQcMob2VY4RmvjwSaucRfDoi p3SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=CZetOe+J; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id q8-20020a17090311c800b001c746b986e2si606733plh.346.2023.10.31.00.11.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 00:11:07 -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; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=CZetOe+J; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CB89D80787C2; Tue, 31 Oct 2023 00:10:50 -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 S1343538AbjJaHKe (ORCPT + 99 others); Tue, 31 Oct 2023 03:10:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343497AbjJaHKc (ORCPT ); Tue, 31 Oct 2023 03:10:32 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5557FC0; Tue, 31 Oct 2023 00:10:24 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39UMxSWv015820; Tue, 31 Oct 2023 07:10:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2023-03-30; bh=aFlek+gaXhKJbUVTWsJQV470BEu2g6P29DQzCjLhqfc=; b=CZetOe+JyVmF3OoVrSmlkLhMZViXF1Md5+FfqPUrtcGkXCb5qCxJOlsKhTFHWGPlgUw6 ms8b6XB674rjj2aTPpWMSfw78bbwnllALDQ7SGNRGiAZnEFAzM5MoLX/ru3Xa+hopqrk +Dq/0ICsFztptZziC+ls7hiKmINVjk+MzHYHd8wu0Bk4Oy0JkSiOeb1OiQrfdJatJydA SZwAQzeCXgHwWsr+beYGa7ZxUTUtxgyFSKbmCfiHwa54Xzd4cz9WgBuFRDdjgBwrEqeD wUA8/jx1gcQ0CVYqbR36lSKYGwrS8kiiVPZNe4940l6LbRttCVj85H7K+VdBTBq5/SpS uw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u0t6b4ajk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 Oct 2023 07:10:06 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39V6JGmo038030; Tue, 31 Oct 2023 07:10:05 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3u0rrbgwbc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 Oct 2023 07:10:05 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39V7A4Jw007065; Tue, 31 Oct 2023 07:10:04 GMT Received: from ca-dev112.us.oracle.com (ca-dev112.us.oracle.com [10.129.136.47]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3u0rrbgw9q-1; Tue, 31 Oct 2023 07:10:04 +0000 From: Harshit Mogalapalli To: Alasdair Kergon , Mike Snitzer , dm-devel@lists.linux.dev, Christian Loehle , linux-kernel@vger.kernel.org Cc: dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org, error27@gmail.com, harshit.m.mogalapalli@oracle.com Subject: [PATCH next] dm delay: Fix missing error code in delay_ctr() Date: Tue, 31 Oct 2023 00:10:00 -0700 Message-ID: <20231031071000.374939-1-harshit.m.mogalapalli@oracle.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-30_13,2023-10-31_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 bulkscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2310310054 X-Proofpoint-GUID: QUuMXlOHf8bZnh_gOpoi-WhjpTvpxUXg X-Proofpoint-ORIG-GUID: QUuMXlOHf8bZnh_gOpoi-WhjpTvpxUXg X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 00:10:50 -0700 (PDT) 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); -- 2.39.3