Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm Call {lmutex...



details:   https://anonhg.NetBSD.org/src/rev/067823fad46a
branches:  trunk
changeset: 790109:067823fad46a
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Sep 19 13:51:44 2013 +0000

description:
Call {lmutex,_sema)_destroy appropriately

diffstat:

 sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c      |  6 ++++++
 sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c     |  8 ++++++++
 sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kern_lib.c |  7 +++++++
 3 files changed, 21 insertions(+), 0 deletions(-)

diffs (88 lines):

diff -r d520297287c0 -r 067823fad46a sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c
--- a/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c       Thu Sep 19 12:05:11 2013 +0000
+++ b/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c       Thu Sep 19 13:51:44 2013 +0000
@@ -682,6 +682,7 @@
                                waiter->bulk_waiter.bulk->userdata = NULL;
                                spin_unlock(&bulk_waiter_spinlock);
                        }
+                       _sema_destroy(&waiter->bulk_waiter.event);
                        kfree(waiter);
                } else {
                        const VCHIQ_BULK_MODE_T mode_waiting =
@@ -810,6 +811,8 @@
                                if (completion->reason ==
                                        VCHIQ_SERVICE_CLOSED) {
                                        unlock_service(service1);
+                                       _sema_destroy(&user_service->insert_event);
+                                       _sema_destroy(&user_service->remove_event);
                                        kfree(user_service);
                                }
 
@@ -1159,6 +1162,8 @@
                        spin_unlock(&msg_queue_spinlock);
 
                        unlock_service(service);
+                       _sema_destroy(&user_service->insert_event);
+                       _sema_destroy(&user_service->remove_event);
                        kfree(user_service);
                }
 
@@ -1192,6 +1197,7 @@
                                        "bulk_waiter - cleaned up %x "
                                        "for pid %d",
                                        (unsigned int)waiter, waiter->pid);
+                               _sema_destroy(&waiter->bulk_waiter.event);
                                kfree(waiter);
                        }
                }
diff -r d520297287c0 -r 067823fad46a sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c
--- a/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c      Thu Sep 19 12:05:11 2013 +0000
+++ b/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_core.c      Thu Sep 19 13:51:44 2013 +0000
@@ -276,6 +276,10 @@
                if (!service->ref_count) {
                        BUG_ON(service->srvstate != VCHIQ_SRVSTATE_FREE);
                        state->services[service->localport] = NULL;
+
+                       _sema_destroy(&service->remove_event);
+                       _sema_destroy(&service->bulk_remove_event);
+                       lmutex_destroy(&service->bulk_mutex);
                } else
                        service = NULL;
        }
@@ -2588,6 +2592,10 @@
                lmutex_unlock(&state->mutex);
 
                if (!pservice) {
+                       _sema_destroy(&service->remove_event);
+                       _sema_destroy(&service->bulk_remove_event);
+                       lmutex_destroy(&service->bulk_mutex);
+
                        kfree(service);
                        service = NULL;
                }
diff -r d520297287c0 -r 067823fad46a sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kern_lib.c
--- a/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kern_lib.c  Thu Sep 19 12:05:11 2013 +0000
+++ b/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kern_lib.c  Thu Sep 19 13:51:44 2013 +0000
@@ -153,8 +153,13 @@
                                        "bulk_waiter - cleaned up %x "
                                        "for pid %d",
                                        (unsigned int)waiter, waiter->pid);
+                       _sema_destroy(&waiter->bulk_waiter.event);
+
                        kfree(waiter);
                }
+
+               lmutex_destroy(&instance->bulk_waiter_list_mutex);
+
                kfree(instance);
        }
 
@@ -436,6 +441,8 @@
                        bulk->userdata = NULL;
                        spin_unlock(&bulk_waiter_spinlock);
                }
+               _sema_destroy(&waiter->bulk_waiter.event);
+
                kfree(waiter);
        } else {
                waiter->pid = current->l_proc->p_pid;



Home | Main Index | Thread Index | Old Index