Skip to content
  1. Feb 07, 2019
  2. Feb 06, 2019
  3. Feb 05, 2019
  4. Feb 04, 2019
    • Bard liao's avatar
      ASoC: topology: unload physical dai link in remove · adfebb51
      Bard liao authored
      
      
      soc_tplg_link_config() will find the physical dai link and call
      soc_tplg_dai_link_load() to load the BE dai link. Currently remove_link()
      is only used to remove the FE dai link which is created by the topology.
      The BE dai link cannot however be unloaded in snd_soc_tplg_component
      _remove(), which is problematic if anything needs to be released or
      reinitialized.
      
      This patch aligns the definitions of dynamic types with the existing
      UAPI and adds a new remove_backend_link() routine to unload the the BE
      dai link when snd_soc_tplg_component_remove() is invoked.
      
      Signed-off-by: default avatarBard liao <yung-chuan.liao@linux.intel.com>
      Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      adfebb51
    • Curtis Malainey's avatar
      ASoC: soc-core: clear platform pointers on error · 78a24e10
      Curtis Malainey authored
      
      
      Originally snd_soc_init_platform was not cleaning up its pointers, this
      was fixed to always reallocate dynamic memory but created a memory leak
      when snd_soc_init_platform was called multiple times during the same
      probe attempt and also threw away any changes made to the struct between
      calls. In order to avoid reallocating memory that is still valid, the
      behaviour will be changed to clear the dynamically set pointers on a
      probe error and a unregister event and snd_soc_init_platform will go
      back to its original behaviour of only allocating null pointers so it will
      stop throwing away valid changes.
      
      Signed-off-by: default avatarCurtis Malainey <cujomalainey@chromium.org>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      78a24e10
    • wen yang's avatar
      ASoC: fsl-asoc-card: fix object reference leaks in fsl_asoc_card_probe · 11907e9d
      wen yang authored
      
      
      The of_find_device_by_node() takes a reference to the underlying device
      structure, we should release that reference.
      
      Signed-off-by: default avatarWen Yang <yellowriver2010@hotmil.com>
      Cc: Timur Tabi <timur@kernel.org>
      Cc: Nicolin Chen <nicoleotsuka@gmail.com>
      Cc: Xiubo Li <Xiubo.Lee@gmail.com>
      Cc: Fabio Estevam <festevam@gmail.com>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: alsa-devel@alsa-project.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      11907e9d
  5. Feb 03, 2019
    • Zhiwei Jiang's avatar
      ASoC: dapm: Add warnings for widget overwrite when adding route · 411db2ab
      Zhiwei Jiang authored
      
      
      Currently, in some complex cases, more than one widgets have same
      name and registed from differnt dapm context, and route add from
      another context too. When snd_soc_dapm_add_route, the previous
      registered widget will overwritten by the latest same name widget,
      will cause unexpect error. For Asoc framework we cant avoid this
      situation and we cant decide which widget that wanted with route.
      At least we can give users a notice.
      
      Signed-off-by: default avatarZhiwei Jiang <qq282012236@gmail.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      411db2ab
    • Charles Keepax's avatar
      ASoC: dapm: Only power up active channels from a DAI · 078a85f2
      Charles Keepax authored
      
      
      Currently all widgets attached to a DAI link will be powered
      up when the DAI is active, however this may include routes
      that are not actually in use if there are unused channels
      available on the DAI.
      
      The macros for creating AIF widgets already include an entry for
      slot, it is proposed to change that to channel. The effective
      difference here being respresenting the logical channel index
      rather than the physical slot index. The CODECs currently
      using the slot entry on the DAPM_AIF macros are using it in
      a manner consistent with this, the CODECs not using it just
      have the field set to zero.
      
      A variable is added to snd_soc_dapm_widget to represent
      this channel index and then for each AIF widget attached to
      a DAI this is compared against the number of channels on
      the stream. Enabling the links for those which will be in
      use. This has the nice property that the CODECs which haven't
      used the slot/channel entry in the macro will function exactly
      as before due to all the AIF widgets having a channel of zero
      and a stream by definition having at least one channel.
      
      Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      078a85f2
    • Guennadi Liakhovetski's avatar
      ASoC: topology: fix oops/use-after-free case with dai driver · 52abe6cc
      Guennadi Liakhovetski authored
      
      
      rmmod/modprobe tests expose a kernel oops when accessing the dai
      driver pointer. This comes from the topology design which operates in
      multiple passes. Each object removal happens at a specific iteration,
      and the code checks for the iteration (order) number after the memory
      containing the order was freed.
      
      Fix this be clearing a reference to the dai driver and check its
      validity to avoid dereferences.
      
      Signed-off-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@intel.com>
      Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      52abe6cc
    • Pierre-Louis Bossart's avatar
      ASoC: dapm: fix use-after-free issue with dailink sname · 199ed3e8
      Pierre-Louis Bossart authored
      Commit 7620fe91
      
       ("ASoC: topology: fix memory leak in
      soc_tplg_dapm_widget_create") fixed a memory leak issue, but
      additional tests and KASAN reports show a use-after-free in soc-dapm.
      
      The widgets are created with a kmemdup operating on a template. The
      "name" string is also duplicated, but the "sname" string is not. As a
      result, when the template is freed after widget creation, its sname
      string is still used.
      
      Fix by explicitly duplicating the "sname" string, and freeing it when
      required.
      
      Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      199ed3e8
  6. Feb 02, 2019
  7. Jan 30, 2019
  8. Jan 29, 2019