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 From https:/...
details: https://anonhg.NetBSD.org/src/rev/05f607864038
branches: trunk
changeset: 330651:05f607864038
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Wed Jul 16 23:59:58 2014 +0000
description:
>From https://github.com/raspberrypi/linux/commit/517d5c1c9ceb7bf94c4e56e4fb97758e13f24b3b
> Fix for ALSA driver crash
> Avoids an issue when closing and opening vchiq where a message can arrive before service handle has been written
diffstat:
sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kern_lib.c | 7 +++--
sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c | 12 ++++++---
2 files changed, 12 insertions(+), 7 deletions(-)
diffs (69 lines):
diff -r 038ff27c50a6 -r 05f607864038 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 Wed Jul 16 23:54:32 2014 +0000
+++ b/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kern_lib.c Wed Jul 16 23:59:58 2014 +0000
@@ -288,12 +288,13 @@
NULL);
if (service) {
+ *phandle = service->handle;
status = vchiq_open_service_internal(service,
(uintptr_t)current);
- if (status == VCHIQ_SUCCESS)
- *phandle = service->handle;
- else
+ if (status != VCHIQ_SUCCESS) {
vchiq_remove_service(service->handle);
+ *phandle = VCHIQ_SERVICE_HANDLE_INVALID;
+ }
}
failed:
diff -r 038ff27c50a6 -r 05f607864038 sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c
--- a/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c Wed Jul 16 23:54:32 2014 +0000
+++ b/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_shim.c Wed Jul 16 23:59:58 2014 +0000
@@ -632,6 +632,9 @@
{
VCHIQ_INSTANCE_T instance = (VCHIQ_INSTANCE_T)instance_handle;
SHIM_SERVICE_T *service = service_alloc(instance, setup);
+
+ *handle = (VCHI_SERVICE_HANDLE_T)service;
+
if (service) {
VCHIQ_SERVICE_PARAMS_T params;
VCHIQ_STATUS_T status;
@@ -648,11 +651,10 @@
if (status != VCHIQ_SUCCESS) {
service_free(service);
service = NULL;
+ *handle = NULL;
}
}
- *handle = (VCHI_SERVICE_HANDLE_T)service;
-
return (service != NULL) ? 0 : -1;
}
EXPORT_SYMBOL(vchi_service_open);
@@ -663,6 +665,9 @@
{
VCHIQ_INSTANCE_T instance = (VCHIQ_INSTANCE_T)instance_handle;
SHIM_SERVICE_T *service = service_alloc(instance, setup);
+
+ *handle = (VCHI_SERVICE_HANDLE_T)service;
+
if (service) {
VCHIQ_SERVICE_PARAMS_T params;
VCHIQ_STATUS_T status;
@@ -678,11 +683,10 @@
if (status != VCHIQ_SUCCESS) {
service_free(service);
service = NULL;
+ *handle = NULL;
}
}
- *handle = (VCHI_SERVICE_HANDLE_T)service;
-
return (service != NULL) ? 0 : -1;
}
EXPORT_SYMBOL(vchi_service_create);
Home |
Main Index |
Thread Index |
Old Index