summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc
diff options
context:
space:
mode:
authorCai Huoqing <caihuoqing@baidu.com>2021-10-21 20:42:54 +0800
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-11-17 17:51:34 +0000
commit2c4ce5041cd5d66875137a854b5e19672dce19a5 (patch)
treea447c126b32a41929cf236e796de550db54a0b9b /drivers/iio/adc
parent4bdc3e967dc6c22e32da0ddba099828415ac4b0e (diff)
downloadlinux-2c4ce5041cd5d66875137a854b5e19672dce19a5.tar.bz2
iio: adc: ina2xx: Avoid double reference counting from get_task_struct/put_task_struct()
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> Link: https://lore.kernel.org/r/20211021124254.3247-2-caihuoqing@baidu.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r--drivers/iio/adc/ina2xx-adc.c2
1 files changed, 0 insertions, 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;
}