lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 21 Oct 2021 20:42:54 +0800
From:   Cai Huoqing <caihuoqing@...du.com>
To:     <lars@...afoo.de>
CC:     Cai Huoqing <caihuoqing@...du.com>,
        Jonathan Cameron <jic23@...nel.org>,
        <linux-iio@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH v2 2/2] 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@...du.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ