diff options
author | 2010-05-17 12:11:21 -0400 | |
---|---|---|
committer | 2010-05-17 12:11:21 -0400 | |
commit | a1e66dd0515c8cfa72b8e2a3834d59548cf84ba5 (patch) | |
tree | e1e1edf210c8dde6edbdfa32ed6ff59ac553729b /lib | |
parent | eeepc-wmi: depends on BACKLIGHT_CLASS_DEVICE (diff) | |
parent | drivers/platform/x86: Clarify the MRST IPC driver description slightly (diff) | |
download | wireguard-linux-a1e66dd0515c8cfa72b8e2a3834d59548cf84ba5.tar.xz wireguard-linux-a1e66dd0515c8cfa72b8e2a3834d59548cf84ba5.zip |
Merge branch 'x86-platform-next' into x86-platform
Diffstat (limited to 'lib')
-rw-r--r-- | lib/btree.c | 3 | ||||
-rw-r--r-- | lib/rwsem.c | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/btree.c b/lib/btree.c index 41859a820218..c9c6f0351526 100644 --- a/lib/btree.c +++ b/lib/btree.c @@ -95,7 +95,8 @@ static unsigned long *btree_node_alloc(struct btree_head *head, gfp_t gfp) unsigned long *node; node = mempool_alloc(head->mempool, gfp); - memset(node, 0, NODESIZE); + if (likely(node)) + memset(node, 0, NODESIZE); return node; } diff --git a/lib/rwsem.c b/lib/rwsem.c index 3e3365e5665e..ceba8e28807a 100644 --- a/lib/rwsem.c +++ b/lib/rwsem.c @@ -136,9 +136,10 @@ __rwsem_do_wake(struct rw_semaphore *sem, int downgrading) out: return sem; - /* undo the change to count, but check for a transition 1->0 */ + /* undo the change to the active count, but check for a transition + * 1->0 */ undo: - if (rwsem_atomic_update(-RWSEM_ACTIVE_BIAS, sem) != 0) + if (rwsem_atomic_update(-RWSEM_ACTIVE_BIAS, sem) & RWSEM_ACTIVE_MASK) goto out; goto try_again; } |