1. 16 8月, 2019 2 次提交
    • W
      ALSA: hiface: fix multiple memory leak bugs · 1c286e4e
      Wenwen Wang 提交于
      commit 3d92aa45fbfd7319e3a19f4ec59fd32b3862b723 upstream.
      
      In hiface_pcm_init(), 'rt' is firstly allocated through kzalloc(). Later
      on, hiface_pcm_init_urb() is invoked to initialize 'rt->out_urbs[i]'. In
      hiface_pcm_init_urb(), 'rt->out_urbs[i].buffer' is allocated through
      kzalloc().  However, if hiface_pcm_init_urb() fails, both 'rt' and
      'rt->out_urbs[i].buffer' are not deallocated, leading to memory leak bugs.
      Also, 'rt->out_urbs[i].buffer' is not deallocated if snd_pcm_new() fails.
      
      To fix the above issues, free 'rt' and 'rt->out_urbs[i].buffer'.
      
      Fixes: a91c3fb2 ("Add M2Tech hiFace USB-SPDIF driver")
      Signed-off-by: NWenwen Wang <wenwen@cs.uga.edu>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1c286e4e
    • W
      ALSA: usb-audio: fix a memory leak bug · d4d904e4
      Wenwen Wang 提交于
      commit a67060201b746a308b1674f66bf289c9faef6d09 upstream.
      
      In snd_usb_get_audioformat_uac3(), a structure for channel maps 'chmap' is
      allocated through kzalloc() before the execution goto 'found_clock'.
      However, this structure is not deallocated if the memory allocation for
      'pd' fails, leading to a memory leak bug.
      
      To fix the above issue, free 'fp->chmap' before returning NULL.
      
      Fixes: 7edf3b5e ("ALSA: usb-audio: AudioStreaming Power Domain parsing")
      Signed-off-by: NWenwen Wang <wenwen@cs.uga.edu>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d4d904e4
  2. 31 7月, 2019 1 次提交
  3. 14 7月, 2019 1 次提交
    • T
      ALSA: usb-audio: Fix parse of UAC2 Extension Units · 87c3262b
      Takashi Iwai 提交于
      commit ca95c7bf3d29716916baccdc77c3c2284b703069 upstream.
      
      Extension Unit (XU) is used to have a compatible layout with
      Processing Unit (PU) on UAC1, and the usb-audio driver code assumed it
      for parsing the descriptors.  Meanwhile, on UAC2, XU became slightly
      incompatible with PU; namely, XU has a one-byte bmControls bitmap
      while PU has two bytes bmControls bitmap.  This incompatibility
      results in the read of a wrong address for the last iExtension field,
      which ended up with an incorrect string for the mixer element name, as
      recently reported for Focusrite Scarlett 18i20 device.
      
      This patch corrects this misalignment by introducing a couple of new
      macros and calling them depending on the descriptor type.
      
      Fixes: 23caaf19 ("ALSA: usb-mixer: Add support for Audio Class v2.0")
      Reported-by: NStefan Sauer <ensonic@hora-obscura.de>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      87c3262b
  4. 10 7月, 2019 2 次提交
  5. 09 6月, 2019 1 次提交
    • T
      ALSA: line6: Assure canceling delayed work at disconnection · eb2eeec9
      Takashi Iwai 提交于
      commit 0b074ab7fc0d575247b9cc9f93bb7e007ca38840 upstream.
      
      The current code performs the cancel of a delayed work at the late
      stage of disconnection procedure, which may lead to the access to the
      already cleared state.
      
      This patch assures to call cancel_delayed_work_sync() at the beginning
      of the disconnection procedure for avoiding that race.  The delayed
      work object is now assigned in the common line6 object instead of its
      derivative, so that we can call cancel_delayed_work_sync().
      
      Along with the change, the startup function is called via the new
      callback instead.  This will make it easier to port other LINE6
      drivers to use the delayed work for startup in later patches.
      
      Reported-by: syzbot+5255458d5e0a2b10bbb9@syzkaller.appspotmail.com
      Fixes: 7f84ff68be05 ("ALSA: line6: toneport: Fix broken usage of timer for delayed execution")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eb2eeec9
  6. 22 5月, 2019 2 次提交
    • W
      ALSA: usb-audio: Fix a memory leak bug · 30dda277
      Wenwen Wang 提交于
      commit cb5173594d50c72b7bfa14113dfc5084b4d2f726 upstream.
      
      In parse_audio_selector_unit(), the string array 'namelist' is allocated
      through kmalloc_array(), and each string pointer in this array, i.e.,
      'namelist[]', is allocated through kmalloc() in the following for loop.
      Then, a control instance 'kctl' is created by invoking snd_ctl_new1(). If
      an error occurs during the creation process, the string array 'namelist',
      including all string pointers in the array 'namelist[]', should be freed,
      before the error code ENOMEM is returned. However, the current code does
      not free 'namelist[]', resulting in memory leaks.
      
      To fix the above issue, free all string pointers 'namelist[]' in a loop.
      Signed-off-by: NWenwen Wang <wang6495@umn.edu>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      30dda277
    • T
      ALSA: line6: toneport: Fix broken usage of timer for delayed execution · 741e3efd
      Takashi Iwai 提交于
      commit 7f84ff68be05ec7a5d2acf8fdc734fe5897af48f upstream.
      
      The line6 toneport driver has code for some delayed initialization,
      and this hits the kernel Oops because mutex and other sleepable
      functions are used in the timer callback.  Fix the abuse by a delayed
      work instead so that everything works gracefully.
      
      Reported-by: syzbot+a07d0142e74fdd595cfb@syzkaller.appspotmail.com
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      741e3efd
  7. 05 5月, 2019 1 次提交
  8. 20 2月, 2019 1 次提交
  9. 13 2月, 2019 1 次提交
  10. 07 2月, 2019 1 次提交
  11. 13 1月, 2019 4 次提交
  12. 17 12月, 2018 1 次提交
  13. 13 12月, 2018 2 次提交
  14. 09 8月, 2018 1 次提交
  15. 02 8月, 2018 2 次提交
  16. 01 8月, 2018 1 次提交
  17. 31 7月, 2018 4 次提交
    • J
      ALSA: usb-audio: Operate UAC3 Power Domains in PCM callbacks · a0a4959e
      Jorge Sanjuan 提交于
      Make use of UAC3 Power Domains associated to an Audio Streaming
      path within the PCM's logic. This means, when there is no audio
      being transferred (pcm is closed), the host will set the Power Domain
      associated to that substream to state D1. When audio is being transferred
      (from hw_params onwards), the Power Domain will be set to D0 state.
      
      This is the way the host lets the device know which Terminal
      is going to be actively used and it is for the device to
      manage its own internal resources on that UAC3 Power Domain.
      
      Note the resume method now sets the Power Domain to D1 state as
      resuming the device doesn't mean audio streaming will occur.
      Signed-off-by: NJorge Sanjuan <jorge.sanjuan@codethink.co.uk>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      a0a4959e
    • J
      ALSA: usb-audio: Add UAC3 Power Domains to suspend/resume · 3f59aa11
      Jorge Sanjuan 提交于
      Set the UAC3 Power Domain state for an Audio Streaming interface
      to D2 state before suspending the device (usb_driver callback).
      This lets the device know there is no intention to use any of the
      Units in the Audio Function and that the host is not going to
      even listen for wake-up events (interrupts) on the units.
      
      When the usb_driver gets resumed, the state D0 (fully powered) will
      be set. This ties up the UAC3 Power Domains to the runtime PM.
      Signed-off-by: NJorge Sanjuan <jorge.sanjuan@codethink.co.uk>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3f59aa11
    • J
      ALSA: usb-audio: AudioStreaming Power Domain parsing · 7edf3b5e
      Jorge Sanjuan 提交于
      Power Domains in the UAC3 spec are mainly intended to be
      associated to an Input or Output Terminal so the host
      changes the power state of the entire capture or playback
      path within the topology.
      
      This patch adds support for finding Power Domains associated
      to an Audio Streaming Interface (bTerminalLink) and adds a
      reference to them in the usb audio substreams (snd_usb_substream).
      Signed-off-by: NJorge Sanjuan <jorge.sanjuan@codethink.co.uk>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7edf3b5e
    • J
      ALSA: usb-audio: Initial Power Domain support · 11785ef5
      Jorge Sanjuan 提交于
      Thee USB Audio Class 3 (UAC3) introduces Power Domains as a new
      feature to let a host turn individual parts of an audio function
      to different power states via USB requests. This lets the device
      get to know a bit amore about what the host is up to in order to
      optimize power consumption efficiently.
      
      The Power Domains are optional for UAC3 configuration but all
      UAC3 devices shall include at least one BADD configuration where
      the support for Power Domains is compulsory.
      
      This patch adds a set of features/helpers to parse these power
      domains and change their status.
      Signed-off-by: NJorge Sanjuan <jorge.sanjuan@codethink.co.uk>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      11785ef5
  18. 27 7月, 2018 1 次提交
  19. 26 7月, 2018 3 次提交
  20. 23 7月, 2018 1 次提交
  21. 19 7月, 2018 1 次提交
  22. 18 7月, 2018 1 次提交
  23. 16 7月, 2018 5 次提交