Am Sonntag, 15. Mai 2005 15:41 schrieb Gabriele Giacone:
> This is a patch against a mISDN patched 2.6.10 kernel.
> I had also CCed i4l developers list but posts by non-members must be
> approved by moderator Karsten Keil.

+static void trust_disconnect(struct usb_interface *interface)
+{
+       trustusb *dev;
+
+        /* prevent skel_open() from racing skel_disconnect() */
+        lock_kernel();
+
+       dev = usb_get_intfdata (interface);
+       usb_set_intfdata (interface, NULL);

1. What are you locking against?
2. It should call usb_kill_urb() on all URBs

In
+static int __devinit trust_probe(struct usb_interface *interface, const struct 
usb_device_id *id)

1. Remove devinit

+       if ((!dev->int01_in_endpointAddr) ||
+               (!dev->int02_in_endpointAddr) ||
+                       (!dev->isoc_out_endpointAddr)) {
+                               dbg("%s: Unexpected endpoints configuration", 
__FUNCTION__);
+                               return -ENODEV;
+       }

2. Memory leak if you find only ISO endpoints

+       /* Clearing endpoint int02_in */
+       ret=usb_clear_halt(dev->udev, usb_rcvintpipe(dev->udev, 
dev->int02_in_endpointAddr));

3. Why?

+       ret=usb_submit_urb(dev->int02_in_urb, GFP_ATOMIC);
+dbg("%s: usb_submit_urb: status = %d", __FUNCTION__, ret);
+dbg_urb(dev->int02_in_urb);

4. May be GFP_KERNEL
5. No error checking

+       trust_table[0] = dev;

6. Why have a table if only one is allowed?

+error:
+       trust_delete (dev);
+       return retval;

7. Memory leak

In
+static void trust_isoc_out_callback (struct urb *urb, struct pt_regs *regs)

1. This does a lot of work. Maybe better in a tasklet.

In
+static int __devinit setup_instance(trustusb *usbta)

1. Remove devinit

+       if (!(usbta->rx_buf = kmalloc(MAX_DFRAME_LEN_L1, GFP_ATOMIC))) {

2. GFP_KERNEL

+       if (!(usbta->rxbch_buf = kmalloc(MAX_DATA_MEM, GFP_ATOMIC))) {
+               err = -ENOMEM;
+               return (err);

3. GFP_KERNEL
4. Memory leak in error case

        HTH
                Oliver


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to