Hi,

you cannot use usb_bulk_msg() on buffers on the stack.

        Regards
                Oliver

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], 2004-01-21 21:54:39+01:00, [EMAIL PROTECTED]
  - DMA to stack


 tiglusb.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)


diff -Nru a/drivers/usb/misc/tiglusb.c b/drivers/usb/misc/tiglusb.c
--- a/drivers/usb/misc/tiglusb.c        Wed Jan 21 21:55:52 2004
+++ b/drivers/usb/misc/tiglusb.c        Wed Jan 21 21:55:52 2004
@@ -161,7 +161,7 @@
        int bytes_to_read = 0;
        int bytes_read = 0;
        int result = 0;
-       char buffer[BULK_RCV_MAX];
+       char *buffer;
        unsigned int pipe;
 
        if (*f_pos)
@@ -173,6 +173,10 @@
        if (!s->dev)
                return -EIO;
 
+       buffer = kmalloc(BULK_RCV_MAX, GFP_KERNEL);
+       if (!buffer)
+               return -ENOMEM;
+
        bytes_to_read = (count >= BULK_RCV_MAX) ? BULK_RCV_MAX : count;
 
        pipe = usb_rcvbulkpipe (s->dev, 1);
@@ -203,6 +207,7 @@
        }
 
       out:
+       kfree(buffer);
        return ret ? ret : bytes_read;
 }
 
@@ -214,7 +219,7 @@
        int bytes_to_write = 0;
        int bytes_written = 0;
        int result = 0;
-       char buffer[BULK_SND_MAX];
+       char *buffer;
        unsigned int pipe;
 
        if (*f_pos)
@@ -226,6 +231,10 @@
        if (!s->dev)
                return -EIO;
 
+       buffer = kmalloc(BULK_SND_MAX, GFP_KERNEL);
+       if (!buffer)
+               return -ENOMEM;
+
        bytes_to_write = (count >= BULK_SND_MAX) ? BULK_SND_MAX : count;
        if (copy_from_user (buffer, buf, bytes_to_write)) {
                ret = -EFAULT;
@@ -258,6 +267,7 @@
        }
 
       out:
+       kfree(buffer);
        return ret ? ret : bytes_written;
 }
 

===================================================================


This BitKeeper patch contains the following changesets:
1.1980
## Wrapped with gzip_uu ##


begin 664 bkpatch10661
M'XL(`%CG#D```[646V_3,!3'G^-/<=!>.D827^+<JJ)V:QG3UJ[J*.(!J4H=
MIZG2-,A)[EMAIL PROTECTED]((_ER?(Y_/N<OG\&\E"HTBLWZLU3H#-X6914:
M>IS7L=Q:6UEG=6X5:J5MLZ+0-CLM<FFW#O8[)65IU^72I!9'>L\TJD0*VE2&
M!K'88:7Z^DF&QFQT/;\;S!#J]>`JC;8K^2`KZ/70,NO'M=Q8F2JB='=<<S`W
M%&-"".68<9?PAOJ,.0UQ\3+6PYAZ0;)T`Q17A5J(0LE^E$NUKJ1(-7UU'(<1
MR@@.L.\P'<?%#AH"[EMAIL PROTECTED]".C8E-"5`2<B=DP04F(<;07K3_2$;@@H")T27\
M/?P5$F#"<#R`JH"RBD2&;H$&ON^CZ8]$(?,//X1PA-%K6"FYZK=THLB;6.VN
MM"^;7:U7&]U;8D=*L:,;<2CW-:/[EMAIL PROTECTED]"(6"S?Q$N[&P8ET'(7-UZ4XCJWC
M4D(Q9]QK&"4NWXO@:9^=*OX=]ZE0O[(R+1%&N..10$\IX7N9,'8L$A9R[W=$
M0L&D_T\E;2[OP51?]K^N^O1$6I^AH2%Q'2#HINT,D48*7B[K))&JJU<[EMAIL PROTECTED]
MVCGT(,NCS:80G<OYW>UB=O5^,1Y\>`77;Z:+V]%L,KH[[R)CG4#G1>[EMAIL PROTECTED]
MR:I66S!'D_OQ:-Q%']&-%LKNK"S1[TOG^\XN&E+B[4C:[F<22OVG21XFPV>2
=N/@1DL.[)E(ILK+.>[EMAIL PROTECTED])?H&<?288%,%````
`
end



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to