Hi!
One of my earlier patches backed out a change that fixed all
copy_to_user calls to properly return -EFAULT if needed. This puts the
change back in.
You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
===================================================================
[EMAIL PROTECTED], 2002-07-13 14:44:05+02:00, [EMAIL PROTECTED]
This re-introduces an accidentally reverted change, that makes
all failed copy_to_user and friends cause to return -EFAULT
correctly in hiddev.c.
hiddev.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff -Nru a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
--- a/drivers/usb/input/hiddev.c Sat Jul 13 14:44:22 2002
+++ b/drivers/usb/input/hiddev.c Sat Jul 13 14:44:22 2002
@@ -399,10 +399,12 @@
dinfo.product = dev->descriptor.idProduct;
dinfo.version = dev->descriptor.bcdDevice;
dinfo.num_applications = hid->maxapplication;
- return copy_to_user((void *) arg, &dinfo, sizeof(dinfo));
+ if (copy_to_user((void *) arg, &dinfo, sizeof(dinfo)))
+ return -EFAULT;
case HIDIOCGFLAG:
- return put_user(list->flags, (int *) arg);
+ if (put_user(list->flags, (int *) arg))
+ return -EFAULT;
case HIDIOCSFLAG:
{
@@ -488,7 +490,8 @@
rinfo.num_fields = report->maxfield;
- return copy_to_user((void *) arg, &rinfo, sizeof(rinfo));
+ if (copy_to_user((void *) arg, &rinfo, sizeof(rinfo)))
+ return -EFAULT;
case HIDIOCGFIELDINFO:
if (copy_from_user(&finfo, (void *) arg, sizeof(finfo)))
@@ -518,7 +521,8 @@
finfo.unit_exponent = field->unit_exponent;
finfo.unit = field->unit;
- return copy_to_user((void *) arg, &finfo, sizeof(finfo));
+ if (copy_to_user((void *) arg, &finfo, sizeof(finfo)))
+ return -EFAULT;
case HIDIOCGUCODE:
if (copy_from_user(&uref, (void *) arg, sizeof(uref)))
@@ -538,7 +542,8 @@
uref.usage_code = field->usage[uref.usage_index].hid;
- return copy_to_user((void *) arg, &uref, sizeof(uref));
+ if (copy_to_user((void *) arg, &uref, sizeof(uref)))
+ return -EFAULT;
case HIDIOCGUSAGE:
case HIDIOCSUSAGE:
@@ -570,7 +575,8 @@
switch (cmd) {
case HIDIOCGUSAGE:
uref.value = field->value[uref.usage_index];
- return copy_to_user((void *) arg, &uref, sizeof(uref));
+ if (copy_to_user((void *) arg, &uref, sizeof(uref)))
+ return -EFAULT;
return 0;
case HIDIOCSUSAGE:
===================================================================
This BitKeeper patch contains the following changesets:
+
## Wrapped with gzip_uu ##
begin 664 bkpatch21911
M'XL(`*8@,#T``ZV5:T_;,!2&/]>_XDA(6SN:U'9N3:<B&+"+AC3$X#-R':?Q
MFL:5XQ2!\N/GA%+605G'%D4ZSK']^-4YKY4]N"J%'G66ZH<1/$-[\%F59M0Q
M-S*7T\RX%;]Q^9W-7RAE\X-,S<5@M7HPF0VJ<N)0-T!VQ3DS/(.ET.6H0UQO
MG3&W"S'J7)Q^NCH[ND!H/(;CC!53\5T8&(_19':85")W9UJQS%5Z6J^G:XHQ
M(80&V`M"$M1TZ'E^34(\2>PPH5&<3L(8K>0<_B9ZDT-Q1#Q"/0NL`^+1")T`
M<<,P!DP'.!H0#X@_\OT1#O8Q'6$,6["P3\#!Z`/\N_!CQ.$RDR5HX<C":)54
M7)3`"F"<RT04AN7YK9VU134B`=[R^V`R9F#.9J*T`+L$4B;S9EXM;J^-NJYL
M3RTE@51+420E<&938)1%F4H7X)Q^/+HZN[2[N=):<&-/D05D,DG$TN4N^@I-
MC4)T_M@KY/SE@Q!F&!T\4Z=$R\8FC7D&#V<^ELS',0EK&D0DJH<3BHF(!/.I
MQ](TWM:4#:0L%I79`*^:[_O8JW%$X["UX?8]S_OR];*W6G0GV708Q#6F)**M
M9VGTQ++>'RU+P0G_FV=/5/'60")7SEF9RF3B8;AD>26L^]1\TY/6@4TL%XR+
MQF1M*[Z!HV_:UWKF_(6NO,*!)SZF0-"7)E#4Z<@4NK\JZG:72B;PK@=,3_OP
M)I%%JOI0RCNATF[[U>OU[,;.YLUYWY"#>W*P)ENQ]]1<EL8Y2',V+?O0M5=[
M=<(V5$Q:E`V[B-0;(O5+(@/:DINP"SG=(*<ODOU[LK\;N=(B78.;CZW<R&NY
A-C3<UY.?LM=_))X)/BNK^3CB290.N8=^`FTR5#((!P``
`
end
--
Vojtech Pavlik
SuSE Labs
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel