Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83473
b: refs/heads/master
c: 1bf4734
h: refs/heads/master
i:
  83471: c9cb9c3
v: v3
  • Loading branch information
Eric Dumazet authored and Linus Torvalds committed Feb 6, 2008
1 parent 7798fa3 commit fdf43ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 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: 6b2fb3c65844452bb9e8b449d50863d1b36c5dc0
refs/heads/master: 1bf47346d75790ebd2563d909d48046961c7ffd5
2 changes: 1 addition & 1 deletion trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ static inline int above_background_load(void)

struct io_context; /* See blkdev.h */
#define NGROUPS_SMALL 32
#define NGROUPS_PER_BLOCK ((int)(PAGE_SIZE / sizeof(gid_t)))
#define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t)))
struct group_info {
int ngroups;
atomic_t usage;
Expand Down
20 changes: 10 additions & 10 deletions trunk/kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,16 +1145,16 @@ static int groups_to_user(gid_t __user *grouplist,
struct group_info *group_info)
{
int i;
int count = group_info->ngroups;
unsigned int count = group_info->ngroups;

for (i = 0; i < group_info->nblocks; i++) {
int cp_count = min(NGROUPS_PER_BLOCK, count);
int off = i * NGROUPS_PER_BLOCK;
int len = cp_count * sizeof(*grouplist);
unsigned int cp_count = min(NGROUPS_PER_BLOCK, count);
unsigned int len = cp_count * sizeof(*grouplist);

if (copy_to_user(grouplist+off, group_info->blocks[i], len))
if (copy_to_user(grouplist, group_info->blocks[i], len))
return -EFAULT;

grouplist += NGROUPS_PER_BLOCK;
count -= cp_count;
}
return 0;
Expand All @@ -1165,16 +1165,16 @@ static int groups_from_user(struct group_info *group_info,
gid_t __user *grouplist)
{
int i;
int count = group_info->ngroups;
unsigned int count = group_info->ngroups;

for (i = 0; i < group_info->nblocks; i++) {
int cp_count = min(NGROUPS_PER_BLOCK, count);
int off = i * NGROUPS_PER_BLOCK;
int len = cp_count * sizeof(*grouplist);
unsigned int cp_count = min(NGROUPS_PER_BLOCK, count);
unsigned int len = cp_count * sizeof(*grouplist);

if (copy_from_user(group_info->blocks[i], grouplist+off, len))
if (copy_from_user(group_info->blocks[i], grouplist, len))
return -EFAULT;

grouplist += NGROUPS_PER_BLOCK;
count -= cp_count;
}
return 0;
Expand Down

0 comments on commit fdf43ec

Please sign in to comment.