Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189273
b: refs/heads/master
c: 40e11e3
h: refs/heads/master
i:
  189271: c3af706
v: v3
  • Loading branch information
Michal Simek committed Apr 1, 2010
1 parent 2345543 commit 1aeb578
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 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: 4270690bd4b1420a8d634ea31953a1c4def2a44a
refs/heads/master: 40e11e3380d4bd14bb3d85c7e7b863075a6a8d86
14 changes: 11 additions & 3 deletions trunk/arch/microblaze/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,19 @@ static inline long copy_to_user(void __user *to,
}

extern int __strncpy_user(char *to, const char __user *from, int len);

#define __strncpy_from_user __strncpy_user

static inline long
strncpy_from_user(char *dst, const char __user *src, long count)
{
if (!access_ok(VERIFY_READ, src, 1))
return -EFAULT;
return __strncpy_from_user(dst, src, count);
}

extern int __strnlen_user(const char __user *sstr, int len);

#define strncpy_from_user(to, from, len) \
(access_ok(VERIFY_READ, from, 1) ? \
__strncpy_user(to, from, len) : -EFAULT)
#define strnlen_user(str, len) \
(access_ok(VERIFY_READ, str, 1) ? __strnlen_user(str, len) : 0)

Expand Down

0 comments on commit 1aeb578

Please sign in to comment.