[haiku-commits] haiku: hrev50979 - in src/system: kernel/arch/x86 boot/loader

  • From: waddlesplash@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 25 Feb 2017 21:29:36 +0100 (CET)

hrev50979 adds 2 changesets to branch 'master'
old head: bccc1aefa428a0a3294645c5b7c9a3db3c87121c
new head: 0414166a294511fcd21e216dfd5c0bdb96ef0bf6
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=0414166a2945+%5Ebccc1aefa428

----------------------------------------------------------------------------

7c6caa89398a: load_driver_settings: Add missing kernel_args_free() call to 
load_driver_settings_file()
  
  Signed-off-by: Augustin Cavalier <waddlesplash@xxxxxxxxx>

                                         [ Lioncash <mathew1800@xxxxxxxxx> ]

0414166a2945: kernel/x86/arch_int: Move cast after NULL check.
  
  Spotted by Lioncash (via IRC). No functional change intended.

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

2 files changed, 5 insertions(+), 2 deletions(-)
src/system/boot/loader/load_driver_settings.cpp | 4 +++-
src/system/kernel/arch/x86/arch_int.cpp         | 3 ++-

############################################################################

Commit:      7c6caa89398a8e91646c9ffdd9c0286c621c6ec9
URL:         http://cgit.haiku-os.org/haiku/commit/?id=7c6caa89398a
Author:      Lioncash <mathew1800@xxxxxxxxx>
Date:        Sat Feb 25 11:59:02 2017 UTC
Committer:   Augustin Cavalier <waddlesplash@xxxxxxxxx>
Commit-Date: Sat Feb 25 20:16:07 2017 UTC

load_driver_settings: Add missing kernel_args_free() call to 
load_driver_settings_file()

Signed-off-by: Augustin Cavalier <waddlesplash@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/src/system/boot/loader/load_driver_settings.cpp 
b/src/system/boot/loader/load_driver_settings.cpp
index 8a2241f..129edd9 100644
--- a/src/system/boot/loader/load_driver_settings.cpp
+++ b/src/system/boot/loader/load_driver_settings.cpp
@@ -37,8 +37,10 @@ load_driver_settings_file(Directory* directory, const char* 
name)
        if (buffer == NULL)
                return B_NO_MEMORY;
 
-       if (read(fd, buffer, stat.st_size) != stat.st_size)
+       if (read(fd, buffer, stat.st_size) != stat.st_size) {
+               kernel_args_free(buffer);
                return B_IO_ERROR;
+       }
 
        driver_settings_file* file = (driver_settings_file*)kernel_args_malloc(
                sizeof(driver_settings_file));

############################################################################

Revision:    hrev50979
Commit:      0414166a294511fcd21e216dfd5c0bdb96ef0bf6
URL:         http://cgit.haiku-os.org/haiku/commit/?id=0414166a2945
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Sat Feb 25 20:27:25 2017 UTC

kernel/x86/arch_int: Move cast after NULL check.

Spotted by Lioncash (via IRC). No functional change intended.

----------------------------------------------------------------------------

diff --git a/src/system/kernel/arch/x86/arch_int.cpp 
b/src/system/kernel/arch/x86/arch_int.cpp
index ea5ada6..08c85af 100644
--- a/src/system/kernel/arch/x86/arch_int.cpp
+++ b/src/system/kernel/arch/x86/arch_int.cpp
@@ -295,8 +295,9 @@ x86_page_fault_exception(struct iframe* frame)
                // TODO: Now we are generally allowing user_memcpy() with 
interrupts
                // disabled, which in most cases is a bug. We should add some 
thread
                // flag allowing to explicitly indicate that this handling is 
desired.
-               uintptr_t handler = 
reinterpret_cast<uintptr_t>(thread->fault_handler);
                if (thread && thread->fault_handler != 0) {
+                       uintptr_t handler =
+                               
reinterpret_cast<uintptr_t>(thread->fault_handler);
                        if (frame->ip != handler) {
                                frame->ip = handler;
                                return;


Other related posts: