Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14562
b: refs/heads/master
c: 4909724
h: refs/heads/master
v: v3
  • Loading branch information
Alexandra Kossovsky authored and David S. Miller committed Nov 20, 2005
1 parent 330a32d commit 2010f52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 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: fb0d366b0803571f06a5b838f02c6706fc287995
refs/heads/master: 4909724b5dee8fb7c52bbe90afa40c65b17be9eb
8 changes: 3 additions & 5 deletions trunk/fs/compat_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,8 @@ static int dev_ifconf(unsigned int fd, unsigned int cmd, unsigned long arg)

ifr = ifc.ifc_req;
ifr32 = compat_ptr(ifc32.ifcbuf);
for (i = 0, j = 0; i < ifc32.ifc_len && j < ifc.ifc_len;
for (i = 0, j = 0;
i + sizeof (struct ifreq32) < ifc32.ifc_len && j < ifc.ifc_len;
i += sizeof (struct ifreq32), j += sizeof (struct ifreq)) {
if (copy_in_user(ifr32, ifr, sizeof (struct ifreq32)))
return -EFAULT;
Expand All @@ -702,10 +703,7 @@ static int dev_ifconf(unsigned int fd, unsigned int cmd, unsigned long arg)
i = ((i / sizeof(struct ifreq)) * sizeof(struct ifreq32));
ifc32.ifc_len = i;
} else {
if (i <= ifc32.ifc_len)
ifc32.ifc_len = i;
else
ifc32.ifc_len = i - sizeof (struct ifreq32);
ifc32.ifc_len = i;
}
if (copy_to_user(compat_ptr(arg), &ifc32, sizeof(struct ifconf32)))
return -EFAULT;
Expand Down

0 comments on commit 2010f52

Please sign in to comment.