Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/common/linux Don't touch a work after it is...



details:   https://anonhg.NetBSD.org/src/rev/8dd80b12eadb
branches:  trunk
changeset: 366352:8dd80b12eadb
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 15:01:47 2018 +0000

description:
Don't touch a work after it is released.

diffstat:

 sys/external/bsd/common/linux/linux_work.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 0ee31bcce96d -r 8dd80b12eadb sys/external/bsd/common/linux/linux_work.c
--- a/sys/external/bsd/common/linux/linux_work.c        Mon Aug 27 15:01:13 2018 +0000
+++ b/sys/external/bsd/common/linux/linux_work.c        Mon Aug 27 15:01:47 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_work.c,v 1.21 2018/08/27 15:01:13 riastradh Exp $        */
+/*     $NetBSD: linux_work.c,v 1.22 2018/08/27 15:01:47 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.21 2018/08/27 15:01:13 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.22 2018/08/27 15:01:47 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/atomic.h>
@@ -286,13 +286,14 @@
                callout_destroy(&dw->dw_callout);
                TAILQ_REMOVE(&wq->wq_delayed, dw, dw_entry);
                release_work(&dw->work, wq);
-               break;
+               /* Can't touch dw any more.  */
+               goto out;
        default:
                panic("delayed work callout in bad state: %p", dw);
        }
        KASSERT(dw->dw_state == DELAYED_WORK_IDLE ||
            dw->dw_state == DELAYED_WORK_SCHEDULED);
-       mutex_exit(&wq->wq_lock);
+out:   mutex_exit(&wq->wq_lock);
 }
 
 struct work_struct *



Home | Main Index | Thread Index | Old Index