Skip to content

Commit

Permalink
iio: adc: ina2xx: Avoid double reference counting from get_task_struc…
Browse files Browse the repository at this point in the history
…t/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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
  • Loading branch information
caihuoqing1990 authored and jic23 committed Nov 17, 2021
1 parent 4bdc3e9 commit 2c4ce50
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/iio/adc/ina2xx-adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit 2c4ce50

Please sign in to comment.