From: Cai Huoqing <caihuoqing@baidu.com>
To: <lars@metafoo.de>
Cc: Cai Huoqing <caihuoqing@baidu.com>,
Jonathan Cameron <jic23@kernel.org>, <linux-iio@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
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 [thread overview]
Message-ID: <20211021124254.3247-2-caihuoqing@baidu.com> (raw)
In-Reply-To: <20211021124254.3247-1-caihuoqing@baidu.com>
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 <caihuoqing@baidu.com>
---
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
next prev parent reply other threads:[~2021-10-21 12:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-21 12:42 [PATCH v2 1/2] iio: adc: ina2xx: Make use of the helper macro kthread_run() Cai Huoqing
2021-10-21 12:42 ` Cai Huoqing [this message]
2021-10-28 16:06 ` Jonathan Cameron
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=20211021124254.3247-2-caihuoqing@baidu.com \
--to=caihuoqing@baidu.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.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®