1. 01 10月, 2019 1 次提交
  2. 19 6月, 2019 1 次提交
  3. 31 5月, 2019 4 次提交
    • W
      ASoC: fsl_utils: fix a leaked reference by adding missing of_node_put · 71efe4c7
      Wen Yang 提交于
      [ Upstream commit c705247136a523488eac806bd357c3e5d79a7acd ]
      
      The call to of_parse_phandle returns a node pointer with refcount
      incremented thus it must be explicitly decremented after the last
      usage.
      
      Detected by coccinelle with the following warnings:
      ./sound/soc/fsl/fsl_utils.c:74:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 38, but without a corresponding     object release within this function.
      Signed-off-by: NWen Yang <wen.yang99@zte.com.cn>
      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: NMark Brown <broonie@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      71efe4c7
    • W
      ASoC: eukrea-tlv320: fix a leaked reference by adding missing of_node_put · b6b7a78c
      Wen Yang 提交于
      [ Upstream commit b820d52e7eed7b30b2dfef5f4213a2bc3cbea6f3 ]
      
      The call to of_parse_phandle returns a node pointer with refcount
      incremented thus it must be explicitly decremented after the last
      usage.
      
      Detected by coccinelle with the following warnings:
      ./sound/soc/fsl/eukrea-tlv320.c:121:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 102, but without a correspo    nding object release within this function.
      ./sound/soc/fsl/eukrea-tlv320.c:127:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 102, but without a correspo    nding object release within this function.
      Signed-off-by: NWen Yang <wen.yang99@zte.com.cn>
      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: linux-kernel@vger.kernel.org
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      b6b7a78c
    • D
      ASoC: fsl_sai: Update is_slave_mode with correct value · c2582f21
      Daniel Baluta 提交于
      [ Upstream commit ddb351145a967ee791a0fb0156852ec2fcb746ba ]
      
      is_slave_mode defaults to false because sai structure
      that contains it is kzalloc'ed.
      
      Anyhow, if we decide to set the following configuration
      SAI slave -> SAI master, is_slave_mode will remain set on true
      although SAI being master it should be set to false.
      
      Fix this by updating is_slave_mode for each call of
      fsl_sai_set_dai_fmt.
      Signed-off-by: NDaniel Baluta <daniel.baluta@nxp.com>
      Acked-by: NNicolin Chen <nicoleotsuka@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      c2582f21
    • A
      ASoC: imx: fix fiq dependencies · 5cf668cf
      Arnd Bergmann 提交于
      [ Upstream commit ea751227c813ab833609afecfeedaf0aa26f327e ]
      
      During randconfig builds, I occasionally run into an invalid configuration
      of the freescale FIQ sound support:
      
      WARNING: unmet direct dependencies detected for SND_SOC_IMX_PCM_FIQ
        Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_IMX_SOC [=m]
        Selected by [y]:
        - SND_SOC_FSL_SPDIF [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_IMX_SOC [=m]!=n && (MXC_TZIC [=n] || MXC_AVIC [=y])
      
      sound/soc/fsl/imx-ssi.o: In function `imx_ssi_remove':
      imx-ssi.c:(.text+0x28): undefined reference to `imx_pcm_fiq_exit'
      sound/soc/fsl/imx-ssi.o: In function `imx_ssi_probe':
      imx-ssi.c:(.text+0xa64): undefined reference to `imx_pcm_fiq_init'
      
      The Kconfig warning is a result of the symbol being defined inside of
      the "if SND_IMX_SOC" block, and is otherwise harmless. The link error
      is more tricky and happens with SND_SOC_IMX_SSI=y, which may or may not
      imply FIQ support. However, if SND_SOC_FSL_SSI is set to =m at the same
      time, that selects SND_SOC_IMX_PCM_FIQ as a loadable module dependency,
      which then causes a link failure from imx-ssi.
      
      The solution here is to make SND_SOC_IMX_PCM_FIQ built-in whenever
      one of its potential users is built-in.
      
      Fixes: ff40260f ("ASoC: fsl: refine DMA/FIQ dependencies")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      5cf668cf
  4. 22 5月, 2019 1 次提交
  5. 17 4月, 2019 1 次提交
  6. 06 4月, 2019 2 次提交
    • W
      ASoC: fsl-asoc-card: fix object reference leaks in fsl_asoc_card_probe · 442caac9
      wen yang 提交于
      [ Upstream commit 11907e9d3533648615db08140e3045b829d2c141 ]
      
      The of_find_device_by_node() takes a reference to the underlying device
      structure, we should release that reference.
      Signed-off-by: NWen 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: NMark Brown <broonie@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      442caac9
    • W
      SoC: imx-sgtl5000: add missing put_device() · 1d836ce7
      Wen Yang 提交于
      [ Upstream commit 8fa857da9744f513036df1c43ab57f338941ae7d ]
      
      The of_find_device_by_node() takes a reference to the underlying device
      structure, we should release that reference.
      
      Detected by coccinelle with the following warnings:
      ./sound/soc/fsl/imx-sgtl5000.c:169:1-7: ERROR: missing put_device;
      call of_find_device_by_node on line 105, but without a corresponding
      object release within this function.
      ./sound/soc/fsl/imx-sgtl5000.c:177:1-7: ERROR: missing put_device;
      call of_find_device_by_node on line 105, but without a corresponding
      object release within this function.
      Signed-off-by: NWen Yang <yellowriver2010@hotmail.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: Shawn Guo <shawnguo@kernel.org>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
      Cc: NXP Linux Team <linux-imx@nxp.com>
      Cc: alsa-devel@alsa-project.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      1d836ce7
  7. 24 3月, 2019 1 次提交
  8. 06 3月, 2019 1 次提交
    • S
      ASoC: imx-audmux: change snprintf to scnprintf for possible overflow · 7bba7aff
      Silvio Cesare 提交于
      [ Upstream commit c407cd008fd039320d147088b52d0fa34ed3ddcb ]
      
      Change snprintf to scnprintf. There are generally two cases where using
      snprintf causes problems.
      
      1) Uses of size += snprintf(buf, SIZE - size, fmt, ...)
      In this case, if snprintf would have written more characters than what the
      buffer size (SIZE) is, then size will end up larger than SIZE. In later
      uses of snprintf, SIZE - size will result in a negative number, leading
      to problems. Note that size might already be too large by using
      size = snprintf before the code reaches a case of size += snprintf.
      
      2) If size is ultimately used as a length parameter for a copy back to user
      space, then it will potentially allow for a buffer overflow and information
      disclosure when size is greater than SIZE. When the size is used to index
      the buffer directly, we can have memory corruption. This also means when
      size = snprintf... is used, it may also cause problems since size may become
      large.  Copying to userspace is mitigated by the HARDENED_USERCOPY kernel
      configuration.
      
      The solution to these issues is to use scnprintf which returns the number of
      characters actually written to the buffer, so the size variable will never
      exceed SIZE.
      Signed-off-by: NSilvio Cesare <silvio.cesare@gmail.com>
      Cc: Timur Tabi <timur@kernel.org>
      Cc: Nicolin Chen <nicoleotsuka@gmail.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Xiubo Li <Xiubo.Lee@gmail.com>
      Cc: Fabio Estevam <fabio.estevam@nxp.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NWilly Tarreau <w@1wt.eu>
      Acked-by: NNicolin Chen <nicoleotsuka@gmail.com>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      7bba7aff
  9. 13 2月, 2019 1 次提交
  10. 04 8月, 2018 1 次提交
  11. 27 7月, 2018 1 次提交
  12. 24 7月, 2018 4 次提交
  13. 05 7月, 2018 1 次提交
  14. 28 5月, 2018 1 次提交
  15. 03 5月, 2018 4 次提交
  16. 26 4月, 2018 1 次提交
    • F
      ASoC: fsl_ssi: Use u32 variable type when using regmap_read() · 671f8204
      Fabio Estevam 提交于
      Convert the sisr and sisr2 variable types to u32 to avoid the following
      sparse warnings:
      
      sound/soc/fsl/fsl_ssi.c:391:42: warning: incorrect type in argument 3 (different base types)
      sound/soc/fsl/fsl_ssi.c:391:42:    expected unsigned int *val
      sound/soc/fsl/fsl_ssi.c:391:42:    got restricted __be32 *<noident>
      sound/soc/fsl/fsl_ssi.c:393:17: warning: restricted __be32 degrades to integer
      sound/soc/fsl/fsl_ssi.c:393:15: warning: incorrect type in assignment (different base types)
      sound/soc/fsl/fsl_ssi.c:393:15:    expected restricted __be32 [usertype] sisr2
      sound/soc/fsl/fsl_ssi.c:393:15:    got unsigned int
      sound/soc/fsl/fsl_ssi.c:396:50: warning: incorrect type in argument 3 (different base types)
      sound/soc/fsl/fsl_ssi.c:396:50:    expected unsigned int [unsigned] val
      sound/soc/fsl/fsl_ssi.c:396:50:    got restricted __be32 [usertype] sisr2
      sound/soc/fsl/fsl_ssi.c:398:42: warning: incorrect type in argument 2 (different base types)
      sound/soc/fsl/fsl_ssi.c:398:42:    expected unsigned int [unsigned] [usertype] sisr
      sound/soc/fsl/fsl_ssi.c:398:42:    got restricted __be32 [addressable] [usertype] sisr
      
      In other places where regmap_read() is used a u32 variable is passed
      to store the register read value, so do the same here as well.
      
      regmap API already takes care of endianness, so the usage of u32 is safe.
      Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      671f8204
  17. 16 4月, 2018 1 次提交
  18. 12 4月, 2018 2 次提交
    • N
      ASoC: fsl_ssi: Fix mode setting when changing channel number · fac8a5a5
      Nicolin Chen 提交于
      This is a partial revert (in a cleaner way) of commit ebf08ae3
      ("ASoC: fsl_ssi: Keep ssi->i2s_net updated") to fix a regression
      at test cases when switching between mono and stereo audio.
      
      The problem is that ssi->i2s_net is initialized in set_dai_fmt()
      only, while this set_dai_fmt() is only called during the dai-link
      probe(). The original patch assumed set_dai_fmt() would be called
      during every playback instance, so it failed at the overriding use
      cases.
      
      This patch adds the local variable i2s_net back to let regular use
      cases still follow the mode settings from the set_dai_fmt().
      
      Meanwhile, the original commit of keeping ssi->i2s_net updated was
      to make set_tdm_slot() clean by checking the ssi->i2s_net directly
      instead of reading SCR register. However, the change itself is not
      necessary (or even harmful) because the set_tdm_slot() might fail
      to check the slot number for Normal-Mode-None-Net settings while
      mono audio cases still need 2 slots. So this patch can also fix it.
      And it adds an extra line of comments to declare ssi->i2s_net does
      not reflect the register value but merely the initial setting from
      the set_dai_fmt().
      Reported-by: NMika Penttilä <mika.penttila@nextfour.com>
      Signed-off-by: NNicolin Chen <nicoleotsuka@gmail.com>
      Tested-by: NMika Penttilä <mika.penttila@nextfour.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      fac8a5a5
    • N
      ASoC: fsl_esai: Fix divisor calculation failure at lower ratio · c656941d
      Nicolin Chen 提交于
      When the desired ratio is less than 256, the savesub (tolerance)
      in the calculation would become 0. This will then fail the loop-
      search immediately without reporting any errors.
      
      But if the ratio is smaller enough, there is no need to calculate
      the tolerance because PM divisor alone is enough to get the ratio.
      
      So a simple fix could be just to set PM directly instead of going
      into the loop-search.
      Reported-by: NMarek Vasut <marex@denx.de>
      Signed-off-by: NNicolin Chen <nicoleotsuka@gmail.com>
      Tested-by: NMarek Vasut <marex@denx.de>
      Reviewed-by: NFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      c656941d
  19. 26 3月, 2018 1 次提交
  20. 27 2月, 2018 1 次提交
  21. 21 2月, 2018 9 次提交