Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145124
b: refs/heads/master
c: fbaa586
h: refs/heads/master
v: v3
  • Loading branch information
Eric Paris authored and James Morris committed May 19, 2009
1 parent 386b554 commit 1c41abe
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 38 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 007a93a1bac9a7c8a936204d0c063faa824942f3
refs/heads/master: fbaa58696cef848de818768783ef185bd3f05158
3 changes: 2 additions & 1 deletion trunk/drivers/char/tpm/tpm_bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ static int get_event_name(char *dest, struct tcpa_event *event,
unsigned char * event_entry)
{
const char *name = "";
char data[40] = "";
/* 41 so there is room for 40 data and 1 nul */
char data[41] = "";
int i, n_len = 0, d_len = 0;
struct tcpa_pc_event *pc_event;

Expand Down
24 changes: 11 additions & 13 deletions trunk/kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ static void drop_futex_key_refs(union futex_key *key)
* @uaddr: virtual address of the futex
* @fshared: 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED
* @key: address where result is stored.
* @rw: mapping needs to be read/write (values: VERIFY_READ, VERIFY_WRITE)
*
* Returns a negative error code or 0
* The key words are stored in *key on success.
Expand All @@ -204,8 +203,7 @@ static void drop_futex_key_refs(union futex_key *key)
*
* lock_page() might sleep, the caller should not hold a spinlock.
*/
static int
get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw)
static int get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key)
{
unsigned long address = (unsigned long)uaddr;
struct mm_struct *mm = current->mm;
Expand All @@ -228,7 +226,7 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw)
* but access_ok() should be faster than find_vma()
*/
if (!fshared) {
if (unlikely(!access_ok(rw, uaddr, sizeof(u32))))
if (unlikely(!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))))
return -EFAULT;
key->private.mm = mm;
key->private.address = address;
Expand All @@ -237,7 +235,7 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw)
}

again:
err = get_user_pages_fast(address, 1, rw == VERIFY_WRITE, &page);
err = get_user_pages_fast(address, 1, 0, &page);
if (err < 0)
return err;

Expand Down Expand Up @@ -679,7 +677,7 @@ static int futex_wake(u32 __user *uaddr, int fshared, int nr_wake, u32 bitset)
if (!bitset)
return -EINVAL;

ret = get_futex_key(uaddr, fshared, &key, VERIFY_READ);
ret = get_futex_key(uaddr, fshared, &key);
if (unlikely(ret != 0))
goto out;

Expand Down Expand Up @@ -725,10 +723,10 @@ futex_wake_op(u32 __user *uaddr1, int fshared, u32 __user *uaddr2,
int ret, op_ret;

retry:
ret = get_futex_key(uaddr1, fshared, &key1, VERIFY_READ);
ret = get_futex_key(uaddr1, fshared, &key1);
if (unlikely(ret != 0))
goto out;
ret = get_futex_key(uaddr2, fshared, &key2, VERIFY_WRITE);
ret = get_futex_key(uaddr2, fshared, &key2);
if (unlikely(ret != 0))
goto out_put_key1;

Expand Down Expand Up @@ -816,10 +814,10 @@ static int futex_requeue(u32 __user *uaddr1, int fshared, u32 __user *uaddr2,
int ret, drop_count = 0;

retry:
ret = get_futex_key(uaddr1, fshared, &key1, VERIFY_READ);
ret = get_futex_key(uaddr1, fshared, &key1);
if (unlikely(ret != 0))
goto out;
ret = get_futex_key(uaddr2, fshared, &key2, VERIFY_READ);
ret = get_futex_key(uaddr2, fshared, &key2);
if (unlikely(ret != 0))
goto out_put_key1;

Expand Down Expand Up @@ -1142,7 +1140,7 @@ static int futex_wait(u32 __user *uaddr, int fshared,
q.bitset = bitset;
retry:
q.key = FUTEX_KEY_INIT;
ret = get_futex_key(uaddr, fshared, &q.key, VERIFY_READ);
ret = get_futex_key(uaddr, fshared, &q.key);
if (unlikely(ret != 0))
goto out;

Expand Down Expand Up @@ -1332,7 +1330,7 @@ static int futex_lock_pi(u32 __user *uaddr, int fshared,
q.pi_state = NULL;
retry:
q.key = FUTEX_KEY_INIT;
ret = get_futex_key(uaddr, fshared, &q.key, VERIFY_WRITE);
ret = get_futex_key(uaddr, fshared, &q.key);
if (unlikely(ret != 0))
goto out;

Expand Down Expand Up @@ -1596,7 +1594,7 @@ static int futex_unlock_pi(u32 __user *uaddr, int fshared)
if ((uval & FUTEX_TID_MASK) != task_pid_vnr(current))
return -EPERM;

ret = get_futex_key(uaddr, fshared, &key, VERIFY_WRITE);
ret = get_futex_key(uaddr, fshared, &key);
if (unlikely(ret != 0))
goto out;

Expand Down
30 changes: 7 additions & 23 deletions trunk/scripts/setlocalversion
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
#!/bin/sh
#
# This scripts adds local version information from the version
# control systems git, mercurial (hg) and subversion (svn).
#
# If something goes wrong, send a mail the kernel build mailinglist
# (see MAINTAINERS) and CC Nico Schottelius
# <nico-linuxsetlocalversion -at- schottelius.org>.
#
#
# Print additional version information for non-release trees.

usage() {
echo "Usage: $0 [srctree]" >&2
Expand All @@ -18,20 +10,12 @@ cd "${1:-.}" || usage

# Check for git and a git repo.
if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then

# If we are at a tagged commit (like "v2.6.30-rc6"), we ignore it,
# because this version is defined in the top level Makefile.
if [ -z "`git describe --exact-match 2>/dev/null`" ]; then

# If we are past a tagged commit (like "v2.6.30-rc5-302-g72357d5"),
# we pretty print it.
if atag="`git describe 2>/dev/null`"; then
echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'

# If we don't have a tag at all we print -g{commitish}.
else
printf '%s%s' -g $head
fi
# Do we have an untagged tag?
if atag=`git describe 2>/dev/null`; then
echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
# add -g${head}, if there is no usable tag
else
printf '%s%s' -g $head
fi

# Is this git on svn?
Expand Down

0 comments on commit 1c41abe

Please sign in to comment.