Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp587940pxb; Thu, 21 Oct 2021 05:47:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrQTwbFaTpuFCUOOvp/yDdJeTyS8cS6AAFEfhw33LUH//EmwboU7hcCsNCIV1Wg6ACArzC X-Received: by 2002:aa7:da84:: with SMTP id q4mr2804113eds.371.1634820422269; Thu, 21 Oct 2021 05:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634820422; cv=none; d=google.com; s=arc-20160816; b=MVCTp68HDO/YNgUXrAnQEwS4XiYTBItC7mK3zk84Fkiia/7nplMr2n7b/Iyfg+5KUR 0PwQdC7fXXjVh1aQIHb3ee39a31zZtnkbyew1HYr06eZJRZeDxwsj+AUZk1ICAu8NLlT nN0Nn9rl0NUhzGAfsfgnBmQePNwiiACw1YrSi0WX5FkmDtKAR0v4m7WtbsiK5k/4qFYF qr18oMrxH5aDixAQ453UdUggPHuwaTnPGQtKUC9O8G9+wvdcPUqU7Q181OHGvCVsywdf rLEv1HLUNpOq0eEwnoqFol03mSC8Sej/6AhyTGElGhDMODz+z/IFar1hfDe1jFwb3Xrh YLEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=JZW7YAW/u1VgmS1KZn3LuWIV/gUpe4nWx3OGxnalMsk=; b=SC02CtvOdfI4tFIyflv6hlZxngYmHTvQG4l0p1D2EzGis+ddaNqDQNVHu6j1qt+Vbo 0RYguE8Qk+kHX1pa4asVoD5Dt6ftLhZoPjKY96D6/QL+0S4cHFhVP82Am3XobRtPuMI1 RIKUgYi5lqsVBLe22tKvJgKozE6oxDsv587ZBohT3joGDZUO0bxVU4411CsIFCKyHb/y 5Hxh44U/8FH6FbjmyDC8BwvUmo6l1589y6pGk3aJ4ab0LRfk9v3sG3euDBxrWVUBxiqQ w5WRmhTFPZ8q59LHzSwHxHA1MJiyqjNx7fUmg5fqLw37+RnRWrkHNkQswhVmV3zfsRA8 eFhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v19si9005788edc.193.2021.10.21.05.46.34; Thu, 21 Oct 2021 05:47:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231129AbhJUMpa (ORCPT + 99 others); Thu, 21 Oct 2021 08:45:30 -0400 Received: from mx24.baidu.com ([111.206.215.185]:57708 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230359AbhJUMp1 (ORCPT ); Thu, 21 Oct 2021 08:45:27 -0400 Received: from BJHW-Mail-Ex09.internal.baidu.com (unknown [10.127.64.32]) by Forcepoint Email with ESMTPS id AE6114C35E40C5CE0558; Thu, 21 Oct 2021 20:43:08 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex09.internal.baidu.com (10.127.64.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 21 Oct 2021 20:43:08 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 21 Oct 2021 20:43:08 +0800 From: Cai Huoqing To: CC: Cai Huoqing , Jonathan Cameron , , Subject: [PATCH v2 2/2] iio: adc: ina2xx: Avoid double reference counting from get_task_struct/put_task_struct() Date: Thu, 21 Oct 2021 20:42:54 +0800 Message-ID: <20211021124254.3247-2-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211021124254.3247-1-caihuoqing@baidu.com> References: <20211021124254.3247-1-caihuoqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex22.internal.baidu.com (172.31.51.16) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex09_2021-10-21 20:43:08:783 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kthread_run() and kthread_stop() already do reference counting of the task, so remove get_task_struct/put_task_struct() to avoid double reference counting. Signed-off-by: Cai Huoqing --- drivers/iio/adc/ina2xx-adc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c index 360d7a00f60d..352f27657238 100644 --- a/drivers/iio/adc/ina2xx-adc.c +++ b/drivers/iio/adc/ina2xx-adc.c @@ -849,7 +849,6 @@ static int ina2xx_buffer_enable(struct iio_dev *indio_dev) if (IS_ERR(task)) return PTR_ERR(task); - get_task_struct(task); chip->task = task; return 0; @@ -861,7 +860,6 @@ static int ina2xx_buffer_disable(struct iio_dev *indio_dev) if (chip->task) { kthread_stop(chip->task); - put_task_struct(chip->task); chip->task = NULL; } -- 2.25.1