[haiku-commits] haiku: hrev48546 - in src: kits/support add-ons/kernel/drivers/input/usb_hid add-ons/kernel/file_systems/userlandfs/server/haiku

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 22 Dec 2014 17:58:15 +0100 (CET)

hrev48546 adds 3 changesets to branch 'master'
old head: 207212972e96a9c3954d0d3ececcd85291b1e18a
new head: cd06fa402b188f2743632c0387fd988aaf2d2fcf
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=cd06fa4+%5E2072129

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

92cc6a0: Style fixes.

d350b0f: Typo.

cd06fa4: CID1108404: missing array inintialization
  
  BuildReportList checks that the array does not already holds the reports
  before adding them. If one of the uninitialized elements happened to be
  the address of one of the reports, it would not get added again,
  possibly leading to items in the array being in the wrong order. Just be
  safe and clear the array.
  
  Fixes #10221, patch there not used as it cluttered the code more than
  needed.

                                 [ Adrien Destugues <pulkomandy@xxxxxxxxx> ]

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

3 files changed, 18 insertions(+), 3 deletions(-)
.../drivers/input/usb_hid/TabletProtocolHandler.cpp |  2 +-
.../userlandfs/server/haiku/haiku_kernel_emu.cpp    | 17 ++++++++++++++++-
src/kits/support/Locker.cpp                         |  2 +-

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

Commit:      92cc6a0f431a94ef90f58ac751c9c530bb0036c8
URL:         http://cgit.haiku-os.org/haiku/commit/?id=92cc6a0
Author:      Adrien Destugues <pulkomandy@xxxxxxxxx>
Date:        Mon Dec 22 14:09:50 2014 UTC

Style fixes.

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

diff --git 
a/src/add-ons/kernel/file_systems/userlandfs/server/haiku/haiku_kernel_emu.cpp 
b/src/add-ons/kernel/file_systems/userlandfs/server/haiku/haiku_kernel_emu.cpp
index eff9541..c7968e1 100644
--- 
a/src/add-ons/kernel/file_systems/userlandfs/server/haiku/haiku_kernel_emu.cpp
+++ 
b/src/add-ons/kernel/file_systems/userlandfs/server/haiku/haiku_kernel_emu.cpp
@@ -66,6 +66,7 @@ notify_entry_created(dev_t device, ino_t directory, const 
char *name,
                directory, node, NULL, name);
 }
 
+
 // notify_entry_removed
 status_t
 notify_entry_removed(dev_t device, ino_t directory, const char *name,
@@ -78,6 +79,7 @@ notify_entry_removed(dev_t device, ino_t directory, const 
char *name,
                directory, node, NULL, name);
 }
 
+
 // notify_entry_moved
 status_t
 notify_entry_moved(dev_t device, ino_t fromDirectory,
@@ -91,6 +93,7 @@ notify_entry_moved(dev_t device, ino_t fromDirectory,
                fromDirectory, toDirectory, node, fromName, toName);
 }
 
+
 // notify_stat_changed
 status_t
 notify_stat_changed(dev_t device, ino_t node, uint32 statFields)
@@ -99,6 +102,7 @@ notify_stat_changed(dev_t device, ino_t node, uint32 
statFields)
                device, 0, 0, node, NULL, NULL);
 }
 
+
 // notify_attribute_changed
 status_t
 notify_attribute_changed(dev_t device, ino_t node, const char *attribute,
@@ -111,6 +115,7 @@ notify_attribute_changed(dev_t device, ino_t node, const 
char *attribute,
                device, 0, 0, node, NULL, attribute);
 }
 
+
 // notify_select_event
 status_t
 notify_select_event(selectsync *sync, uint8 event)
@@ -118,6 +123,7 @@ notify_select_event(selectsync *sync, uint8 event)
        return UserlandFS::KernelEmu::notify_select_event(sync, event, false);
 }
 
+
 // notify_query_entry_created
 status_t
 notify_query_entry_created(port_id port, int32 token, dev_t device,
@@ -130,6 +136,7 @@ notify_query_entry_created(port_id port, int32 token, dev_t 
device,
                device, directory, name, node);
 }
 
+
 // notify_query_entry_removed
 status_t
 notify_query_entry_removed(port_id port, int32 token, dev_t device,
@@ -168,6 +175,7 @@ new_vnode(fs_volume *_volume, ino_t vnodeID, void 
*privateNode,
        return error;
 }
 
+
 // publish_vnode
 status_t
 publish_vnode(fs_volume *_volume, ino_t vnodeID, void *privateNode,
@@ -191,6 +199,7 @@ publish_vnode(fs_volume *_volume, ino_t vnodeID, void 
*privateNode,
        return error;
 }
 
+
 // get_vnode
 status_t
 get_vnode(fs_volume *_volume, ino_t vnodeID, void **privateNode)
@@ -204,12 +213,13 @@ get_vnode(fs_volume *_volume, ino_t vnodeID, void 
**privateNode)
        if (error != B_OK)
                return error;
 
-       if (privateNode)
+       if (privateNode != NULL)
                *privateNode = ((HaikuKernelNode*)foundNode)->private_node;
 
        return B_OK;
 }
 
+
 // put_vnode
 status_t
 put_vnode(fs_volume *_volume, ino_t vnodeID)
@@ -219,6 +229,7 @@ put_vnode(fs_volume *_volume, ino_t vnodeID)
        return UserlandFS::KernelEmu::put_vnode(volume->GetID(), vnodeID);
 }
 
+
 // acquire_vnode
 status_t
 acquire_vnode(fs_volume *_volume, ino_t vnodeID)
@@ -228,6 +239,7 @@ acquire_vnode(fs_volume *_volume, ino_t vnodeID)
        return UserlandFS::KernelEmu::acquire_vnode(volume->GetID(), vnodeID);
 }
 
+
 // remove_vnode
 status_t
 remove_vnode(fs_volume *_volume, ino_t vnodeID)
@@ -237,6 +249,7 @@ remove_vnode(fs_volume *_volume, ino_t vnodeID)
        return UserlandFS::KernelEmu::remove_vnode(volume->GetID(), vnodeID);
 }
 
+
 // unremove_vnode
 status_t
 unremove_vnode(fs_volume *_volume, ino_t vnodeID)
@@ -246,6 +259,7 @@ unremove_vnode(fs_volume *_volume, ino_t vnodeID)
        return UserlandFS::KernelEmu::unremove_vnode(volume->GetID(), vnodeID);
 }
 
+
 // get_vnode_removed
 status_t
 get_vnode_removed(fs_volume *_volume, ino_t vnodeID, bool* removed)
@@ -256,6 +270,7 @@ get_vnode_removed(fs_volume *_volume, ino_t vnodeID, bool* 
removed)
                removed);
 }
 
+
 // volume_for_vnode
 fs_volume*
 volume_for_vnode(fs_vnode *vnode)

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

Commit:      d350b0f0d455b12621d82fe6af25fcfb1252137d
URL:         http://cgit.haiku-os.org/haiku/commit/?id=d350b0f
Author:      Adrien Destugues <pulkomandy@xxxxxxxxx>
Date:        Mon Dec 22 14:14:13 2014 UTC

Typo.

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

diff --git a/src/kits/support/Locker.cpp b/src/kits/support/Locker.cpp
index 63faadb..8ba01b8 100644
--- a/src/kits/support/Locker.cpp
+++ b/src/kits/support/Locker.cpp
@@ -112,7 +112,7 @@ void
 BLocker::Unlock()
 {
        // The Be Book explicitly allows any thread, not just the lock owner, to
-       // unlock. This is bad practise and Haiku should not allow it.
+       // unlock. This is bad practice and Haiku should not allow it.
        if (!IsLocked())
                debugger("Trying to unlock from the wrong thread (#6400)");
 

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

Revision:    hrev48546
Commit:      cd06fa402b188f2743632c0387fd988aaf2d2fcf
URL:         http://cgit.haiku-os.org/haiku/commit/?id=cd06fa4
Author:      Adrien Destugues <pulkomandy@xxxxxxxxx>
Date:        Mon Dec 22 16:52:06 2014 UTC

Ticket:      https://dev.haiku-os.org/ticket/10221

CID1108404: missing array inintialization

BuildReportList checks that the array does not already holds the reports
before adding them. If one of the uninitialized elements happened to be
the address of one of the reports, it would not get added again,
possibly leading to items in the array being in the wrong order. Just be
safe and clear the array.

Fixes #10221, patch there not used as it cluttered the code more than
needed.

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

diff --git a/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp 
b/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp
index c5507c5..4889158 100644
--- a/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp
+++ b/src/add-ons/kernel/drivers/input/usb_hid/TabletProtocolHandler.cpp
@@ -147,7 +147,7 @@ TabletProtocolHandler::AddHandlers(HIDDevice &device, 
HIDCollection &collection,
                return;
 
        uint32 inputReportCount = 0;
-       HIDReport *inputReports[maxReportCount];
+       HIDReport *inputReports[maxReportCount] = {0};
        collection.BuildReportList(HID_REPORT_TYPE_INPUT, inputReports,
                inputReportCount);
 


Other related posts: