Hi,

I'm trying to make this work. The driver only creates mulitple ports if there 
are multiple bulk_out endpoints. My device has 2 bulk_in and one bulk_out.  
So I made the following change:

 #ifdef CONFIG_USB_SERIAL_GENERIC
        if (type == &usb_serial_generic_device) {
-               num_ports = num_bulk_out;
+               num_ports = max(num_bulk_out, num_bulk_in);
                if (num_ports == 0) {
                        dev_err(&interface->dev, "Generic device with no bulk 
out, not allowed.\n");
                        kfree (serial);

Then everything appears to work fine, until I plug in another, different 
device (max_endpoints = 1) while the first (max_endpoints = 2) remains 
inserted. Then I get a kernel oops due to a null dentry ptr passed to 
create_dir() as follows:

Unable to handle kernel NULL pointer dereference at virtual address 00000008
Internal error: Oops: 7 [#1]
CPU: 0
pc : [<c00a8354>]    lr : [<c00a84b4>]    Not tainted
Using defaults from ksymoops -t elf32-i386 -a i386
sp : c0b91ee4  ip : c0b91f04  fp : c0b91f00
r10: 00000002  r9 : c0b90000  r8 : c021ae48
Warning (Oops_set_i370_regs): garbage 'r9 : c0b90000  r8 : c021ae48' at end 
of i370 register line ignored
r7 : 00000000  r6 : 00000000  r5 : 00000000  r4 : bf004454
r3 : c0b91f04  r2 : bf004458  r1 : 00000000  r0 : bf004454
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  Segment user
Control: 397F  Table: A0B98000  DAC: 00000015
Stack: (0xc0b91ee4 to 0xc0b92000)
1ee0:          bf004454 00000000 00000000 00000000 c0b91f18 c0b91f04 c00a84b4
1f00: c00a8350 00000000 bf004454 c0b91f30 c0b91f1c c00e122c c00a844c bf004454
1f20: bf0043b8 c0b91f4c c0b91f34 c00e16b4 c00e1214 bf0043a4 bf0043a8 00000000
1f40: c0b91f64 c0b91f50 c01132c0 c00e1614 00000000 bf004704 c0b91f80 c0b91f68
1f60: bf006054 c0113288 c021ae60 bf0044a0 c0b90000 c0b91fa4 c0b91f84 c0057958
1f80: bf00600c 00000001 00000000 0000000a 00000080 c0025604 00000000 c0b91fa8
1fa0: c0025480 c005779c 00000000 0000000a 00900080 40000000 0005877e 0016f000
1fc0: 00000001 00000000 0000000a befffe54 0016ef00 0016b000 00000002 0008af28
1fe0: 00000000 beffdb74 00026898 0006d9e4 00000010 00900080 00000000 00000000
Backtrace:
Function entered at [<c00a8344>] from [<c00a84b4>]
 r7 = 00000000  r6 = 00000000  r5 = 00000000  r4 = BF004454
Function entered at [<c00a8440>] from [<c00e122c>]
 r4 = BF004454
Function entered at [<c00e1208>] from [<c00e16b4>]
 r5 = BF0043B8  r4 = BF004454
Function entered at [<c00e1608>] from [<c01132c0>]
 r6 = 00000000  r5 = BF0043A8  r4 = BF0043A4
Function entered at [<c011327c>] from [<bf006054>]
 r5 = BF004704  r4 = 00000000
Function entered at [<bf006000>] from [<c0057958>]
 r6 = C0B90000  r5 = BF0044A0  r4 = C021AE60
Function entered at [<c0057790>] from [<c0025480>]
 r8 = C0025604  r7 = 00000080  r6 = 0000000A  r5 = 00000000
 r4 = 00000001
Code: e1a0c00d e92dd8f0 e24cb004 e1a06001 (e5911008)

>>EIP; c00a8354 <create_dir+10/d4>   <=====
Trace; c00a8344 <create_dir+0/d4>
Trace; c00a84b4 <sysfs_create_dir+74/88>
Trace; c00a8440 <sysfs_create_dir+0/88>
Trace; c00e122c <create_dir+24/50>
Trace; c00e1208 <create_dir+0/50>
Trace; c00e16b4 <kobject_add+ac/138>
Trace; c00e1608 <kobject_add+0/138>
Trace; c01132c0 <bus_register+44/7c>
Trace; c011327c <bus_register+0/7c>
Trace; bf006054 Before first symbol
Trace; bf006000 Before first symbol
Trace; c0057958 <sys_init_module+1c8/374>
Trace; c0057790 <sys_init_module+0/374>
Trace; c0025480 <ret_fast_syscall+0/2c>
Code;  c00a8344 <create_dir+0/d4>
00000000 <_EIP>:
Code;  c00a8344 <create_dir+0/d4>
   0:   0d c0 a0 e1 f0            or     $0xf0e1a0c0,%eax
Code;  c00a8348 <create_dir+4/d4>
   5:   d8 2d e9 04 b0 4c         fsubrs 0x4cb004e9
Code;  c00a834e <create_dir+a/d4>
   b:   e2 01                     loop   e <_EIP+0xe> c00a8352 
<create_dir+e/d4>Code;  c00a8350 <create_dir+c/d4>
   d:   60                        pusha
Code;  c00a8352 <create_dir+e/d4>   <=====
   e:   a0 e1 08 10 91            mov    0x911008e1,%al   <=====
Code;  c00a8356 <create_dir+12/d4>
  13:   e5 00                     in     $0x0,%eax


Should this work?

Thanks, Kyle.


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to