Skip to content
  1. Feb 03, 2019
    • 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
    • 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
  2. Feb 02, 2019
  3. Jan 30, 2019
  4. Jan 29, 2019