1. 19 7月, 2010 1 次提交
  2. 05 6月, 2010 1 次提交
    • A
      USB: cdc-acm: fix resource reclaim in error path of acm_probe · c2572b78
      Axel Lin 提交于
      This patch fixes resource reclaim in error path of acm_probe:
      
      1. In the case of "out of memory (read urbs usb_alloc_urb)\n")", there
         is no need to call acm_read_buffers_free(acm) here.  Fix it by goto
         alloc_fail6 instead of alloc_fail7.
      2. In the case of "out of memory (write urbs usb_alloc_urb)",
         usb_alloc_urb may fail in any iteration of the for loop.  Current
         implementation does not properly free allocated snd->urb.  Fix it by
         goto alloc_fail8 instead of alloc_fail7.
      3. In the case of device_create_file(&intf->dev,&dev_attr_iCountryCodeRelDate)
         fail, acm->country_codes is kfreed. As a result, device_remove_file
         for dev_attr_wCountryCodes will not be executed in acm_disconnect.
         Fix it by calling device_remove_file for dev_attr_wCountryCodes
         before goto skip_countries.
      Signed-off-by: NAxel Lin <axel.lin@gmail.com>
      Acked-by: NOliver Neukum <oneukum@suse.de>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c2572b78
  3. 21 5月, 2010 1 次提交
  4. 01 5月, 2010 1 次提交
  5. 19 3月, 2010 1 次提交
  6. 03 3月, 2010 7 次提交
  7. 12 12月, 2009 1 次提交
    • A
      USB: Exposing second ACM channel as tty for Nokia S60 phones. · c1479a92
      Adrian Taylor 提交于
      Nokia S60 phones expose two ACM channels. The first is a modem and is picked
      up by the standard AT-command interface information in the CDC-ACM driver. The
      second is marked as having a vendor-specific protocol. Normally, we don't
      expose those as ttys. (On some other devices, they may be claimed by the
      rndis_host driver and used as a network interface).
      
      But on S60 this second ACM channel is the way that third-party S60 application
      developers are expected to communicate over USB. It acts as a serial device
      at the S60 end, and so it should on Linux too.
      
      The list of devices is largely derived from:
      http://wiki.forum.nokia.com/index.php/S60_Platform_and_device_identification_codes
      http://wiki.forum.nokia.com/index.php/Nokia_USB_Product_IDs
      and includes only the S60 3rd Edition+ devices documented there.
      
      There are many devices for which the USB device ID is not documented,
      including:
          Nokia 6290
          Nokia E63
          Nokia 5630 XpressMusic
          Nokia 5730 XpressMusic
          Nokia 6710 Navigator
          Nokia 6720 classic
          Nokia 6730 Classic
          Nokia 6760 slide
          Nokia 6790 slide
          Nokia 6790 Surge
          Nokia E52
          Nokia E55
          Nokia E71x (AT&T)
          Nokia E72
          Nokia E75
          Nokia E75 US+LTA variant
          Nokia N79
          Nokia N86 8MP
          Nokia 5230 (RM-588)
          Nokia 5230 (RM-594)
          Nokia 5530 XpressMusic
          Nokia 5530 XpressMusic (china)
          Nokia 5800 XM
          Nokia N97 (RM-506)
          Nokia N97 mini
          Nokia X6
      It would be good to add those subsequently.
      Signed-off-by: NAdrian Taylor <aat@realvnc.com>
      Acked-by: NOliver Neukum <oliver@neukum.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c1479a92
  8. 18 11月, 2009 2 次提交
    • F
      USB: cdc_acm: Fix memory leak after hangup · 051522bb
      Francesco Lavra 提交于
      Am Donnerstag, 10. September 2009 15:43:53 schrieb Dietmar Hilbrich:
      > Hello,
      >
      > i have the following problem with the cdc-acm - driver:
      >
      > I'm using the driver with an "Ericsson F3507G" on a Thinkpad T400.
      >
      > If a disable the device (with the RFKill-Switch) while it is used by a
      > programm like ppp, the driver doesn't seem to correctly clean up the tty,
      > even after the program has been closed)
      >
      > The tty is still active (e.g. there still exists an entry in
      > /sys/dev/char/166:0 if ttyACM0 was used) and if a reacticate the device,
      > this device entry will be skipped and the Device-Nodes ttyACM1, ttyACM2
      > and ttyACM3 will be used.
      >
      > This problem was introduced with the commit
      > 10077d4a (before 2.6.31-rc1) and still
      > exists in 2.6.31.
      >
      > I was able the fix this problem with the following patch:
      >
      > diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
      > index 2bfc41e..0970d2f 100644
      > --- a/drivers/usb/class/cdc-acm.c
      > +++ b/drivers/usb/class/cdc-acm.c
      > @@ -676,6 +676,7 @@ static void acm_tty_hangup(struct tty_struct *tty)
      >         struct acm *acm = tty->driver_data;
      >         tty_port_hangup(&acm->port);
      >         acm_port_down(acm, 0);
      > +       acm_tty_unregister(acm);
      >  }
      
      I have the same problem with cdc-acm (I'm using a Samsung SGH-U900): when I
      unplug it from the USB port during a PPP connection, the ppp daemon gets the
      hangup correctly (and closes the device), but the struct acm corresponding to
      the device disconnected is not freed. Hence reconnecting the device results in
      creation of /dev/ttyACM(x+1). The same happens when the system is hibernated
      during a PPP connection.
      
      This memory leak is due to the fact that when the tty is hung up,
      tty_port_close_start() returns always zero, and acm_tty_close() never reaches
      the point where acm_tty_unregister() is called.
      
      Here is a fix for this.
      Signed-off-by: NFrancesco Lavra <francescolavra@interfree.it>
      Acked-by: NOliver Neukum <oliver@neukum.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      051522bb
    • H
      USB: cdc_acm: Fix race condition when opening tty · 18a77b5d
      Henry Gebhardt 提交于
      If acm_rx_tasklet() gets called before tty_port_block_til_ready()
      returns, then bulk IN urbs may not be sent. This fixes it.
      Signed-off-by: NHenry Gebhardt <gebhardt@astro.uni-tuebingen.de>
      Acked-by: NOliver Neukum <oliver@neukum.org>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      18a77b5d
  9. 23 9月, 2009 1 次提交
  10. 20 9月, 2009 1 次提交
  11. 08 8月, 2009 1 次提交
  12. 21 7月, 2009 1 次提交
  13. 13 7月, 2009 1 次提交
  14. 26 6月, 2009 2 次提交
  15. 16 6月, 2009 2 次提交
  16. 11 6月, 2009 3 次提交
  17. 29 5月, 2009 1 次提交
  18. 14 4月, 2009 1 次提交
  19. 07 4月, 2009 2 次提交
  20. 28 2月, 2009 2 次提交
  21. 10 2月, 2009 1 次提交
  22. 28 1月, 2009 3 次提交
  23. 08 1月, 2009 1 次提交
    • A
      USB: Enhance usage of pm_message_t · 65bfd296
      Alan Stern 提交于
      This patch (as1177) modifies the USB core suspend and resume
      routines.  The resume functions now will take a pm_message_t argument,
      so they will know what sort of resume is occurring.  The new argument
      is also passed to the port suspend/resume and bus suspend/resume
      routines (although they don't use it for anything but debugging).
      
      In addition, special pm_message_t values are used for user-initiated,
      device-initiated (i.e., remote wakeup), and automatic suspend/resume.
      By testing these values, drivers can tell whether or not a particular
      suspend was an autosuspend.  Unfortunately, they can't do the same for
      resumes -- not until the pm_message_t argument is also passed to the
      drivers' resume methods.  That will require a bigger change.
      
      IMO, the whole Power Management framework should have been set up this
      way in the first place.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      65bfd296
  24. 14 11月, 2008 1 次提交
    • B
      USB: cdc-acm.c: fix recursive lock in acm_start_wb error path · ad0b65ef
      Brandon Philips 提交于
      Fixes an obvious bug in cdc-acm by avoiding a recursive lock on
      acm_start_wb()'s error path. Should apply towards 2.6.27 stable and
      2.6.28.
      
      =============================================
      [ INFO: possible recursive locking detected ]
      2.6.27-2-pae #109
      ---------------------------------------------
      python/31449 is trying to acquire lock:
       (&acm->write_lock){++..}, at: [<f89a0348>] acm_start_wb+0x5c/0x7b [cdc_acm]
      
      but task is already holding lock:
       (&acm->write_lock){++..}, at: [<f89a04fb>] acm_tty_write+0xe1/0x167 [cdc_acm]
      
      other info that might help us debug this:
      2 locks held by python/31449:
       #0:  (&tty->atomic_write_lock){--..}, at: [<c0260fae>] tty_write_lock+0x14/0x3b
       #1:  (&acm->write_lock){++..}, at: [<f89a04fb>] acm_tty_write+0xe1/0x167 [cdc_acm]
      
      stack backtrace:
      Pid: 31449, comm: python Not tainted 2.6.27-2-pae #109
       [<c030f42f>] ? printk+0xf/0x18
       [<c0149f33>] __lock_acquire+0xc7b/0x1316
       [<c014a63e>] lock_acquire+0x70/0x97
       [<f89a0348>] ? acm_start_wb+0x5c/0x7b [cdc_acm]
       [<c0312109>] _spin_lock_irqsave+0x37/0x47
       [<f89a0348>] ? acm_start_wb+0x5c/0x7b [cdc_acm]
       [<f89a0348>] acm_start_wb+0x5c/0x7b [cdc_acm]
       [<f89a055d>] acm_tty_write+0x143/0x167 [cdc_acm]
       [<c0262a98>] write_chan+0x1cd/0x297
       [<c012527e>] ? default_wake_function+0x0/0xd
       [<c026111e>] tty_write+0x149/0x1b9
       [<c02628cb>] ? write_chan+0x0/0x297
       [<c01912c5>] ? rw_verify_area+0x76/0x98
       [<c0260fd5>] ? tty_write+0x0/0x1b9
       [<c01919ba>] vfs_write+0x8c/0x136
       [<c0191afd>] sys_write+0x3b/0x60
       [<c0103beb>] sysenter_do_call+0x12/0x3f
       =======================
      Signed-off-by: NBrandon Philips <bphilips@suse.de>
      Cc: Oliver Neukum <oliver@neukum.org>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ad0b65ef
  25. 23 10月, 2008 1 次提交