From 942d411b673bbb901f0b2ccf1f2904fcd00b0a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 9 Feb 2005 17:56:21 +0000 Subject: [PATCH] Fixed kernel version of load_driver_setting(): the lock was not properly released under certain conditions. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11298 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/libroot/os/driver_settings.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/kernel/libroot/os/driver_settings.c b/src/kernel/libroot/os/driver_settings.c index f57680273a..2b051c7d85 100644 --- a/src/kernel/libroot/os/driver_settings.c +++ b/src/kernel/libroot/os/driver_settings.c @@ -721,8 +721,10 @@ load_driver_settings(const char *driverName) } // we are allowed to call the driver settings pretty early in the boot process - if (kernel_startup) + if (kernel_startup) { + mutex_unlock(&sLock); return NULL; + } #endif // _KERNEL_MODE #ifdef _BOOT_MODE // see if we already have these settings loaded @@ -748,8 +750,12 @@ load_driver_settings(const char *driverName) file = open(path, O_RDONLY); } - if (file < B_OK) + if (file < B_OK) { +#ifdef _KERNEL_MODE + mutex_unlock(&sLock); +#endif return NULL; + } handle = load_driver_settings_from_file(file, driverName);