aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netback/interface.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <[email protected]>2023-09-07 23:40:48 +0000
committerAndrew Morton <[email protected]>2023-10-04 17:41:57 +0000
commit6309727ef27162deabd5c095c11af24970fba5a2 (patch)
tree84e15c2ddc239bd049b2de325d63067badb85a1d /drivers/net/xen-netback/interface.c
parenttaskstats: fill_stats_for_tgid: use for_each_thread() (diff)
downloadkernel-6309727ef27162deabd5c095c11af24970fba5a2.tar.gz
kernel-6309727ef27162deabd5c095c11af24970fba5a2.zip
kthread: add kthread_stop_put
Add a kthread_stop_put() helper that stops a thread and puts its task struct. Use it to replace the various instances of kthread_stop() followed by put_task_struct(). Remove the kthread_stop_put() macro in usbip that is similar but doesn't return the result of kthread_stop(). [[email protected]: fix kerneldoc comment] Link: https://lkml.kernel.org/r/[email protected] [[email protected]: document kthread_stop_put()'s argument] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'drivers/net/xen-netback/interface.c')
-rw-r--r--drivers/net/xen-netback/interface.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index f3f2c07423a6..33c8143619f0 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -672,8 +672,7 @@ err:
static void xenvif_disconnect_queue(struct xenvif_queue *queue)
{
if (queue->task) {
- kthread_stop(queue->task);
- put_task_struct(queue->task);
+ kthread_stop_put(queue->task);
queue->task = NULL;
}