Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1717415

Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

From Donglin Peng <dolinux.peng@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai
Date 2017-08-22 15:30 +0200
Message-ID <uhhpM-2XF-13@gated-at.bofh.it> (permalink)
References <uhcgp-7KH-5@gated-at.bofh.it> <uhcq6-83s-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi jeffy,

On Tue, Aug 22, 2017 at 3:57 PM, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:

> @@ -978,7 +978,8 @@ struct snd_soc_dai *snd_soc_find_dai(
>                 if (dlc->name && strcmp(component->name, dlc->name))
>                         continue;
>                 list_for_each_entry(dai, &component->dai_list, list) {
> -                       if (dlc->dai_name && strcmp(dai->name, dlc->dai_name))
> +                       if (dlc->dai_name && strcmp(dai->name, dlc->dai_name)
> +                           && strcmp(dai->driver->name, dlc->dai_name))

In case that dai->driver->name is NULL, strcmp(dai->driver->name,
dlc->dai_name) will cause segmentation fault.
so I think that we can change it as the follows:

                      if (dlc->dai_name && strcmp(dai->name, dlc->dai_name)
                           && dai->driver->name &&
strcmp(dai->driver->name, dlc->dai_name))

>                                 continue;
>
>                         return dai;
> --
> 2.11.0
>
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 0/9] ASoC: rockchip: Parse dai links from dts Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-08-22 10:00 +0200
  [PATCH v5 4/9] arm64: dts: rockchip: Add rt5514 dsp for Gru Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-08-22 10:00 +0200
  [PATCH v5 3/9] ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-08-22 10:00 +0200
  [PATCH v5 1/9] ASoC: rockchip: Remove obsolete dmic-delay Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-08-22 10:00 +0200
    Re: [PATCH v5 1/9] ASoC: rockchip: Remove obsolete dmic-delay Mark Brown <broonie@kernel.org> - 2017-08-22 12:40 +0200
      Re: [PATCH v5 1/9] ASoC: rockchip: Remove obsolete dmic-delay jeffy <jeffy.chen@rock-chips.com> - 2017-08-22 13:10 +0200
  [PATCH v5 8/9] ASoC: rockchip: Add support for DMIC codec Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-08-22 10:00 +0200
  [PATCH v5 5/9] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-08-22 10:00 +0200
  [PATCH v5 6/9] ASoC: rockchip: Parse dai links from dts Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-08-22 10:00 +0200
    Re: [PATCH v5 6/9] ASoC: rockchip: Parse dai links from dts Donglin Peng <dolinux.peng@gmail.com> - 2017-08-22 11:10 +0200
      Re: [PATCH v5 6/9] ASoC: rockchip: Parse dai links from dts jeffy <jeffy.chen@rock-chips.com> - 2017-08-22 11:30 +0200
  [PATCH v5 7/9] ASoC: rockchip: Add support for DP codec Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-08-22 10:00 +0200
  [PATCH v5 9/9] dt-bindings: ASoC: rockchip: Update description of rockchip,codec Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-08-22 10:10 +0200
  [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai Jeffy Chen <jeffy.chen@rock-chips.com> - 2017-08-22 10:10 +0200
    Applied "ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai" to the asoc tree Mark Brown <broonie@kernel.org> - 2017-08-22 14:50 +0200
    Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai Donglin Peng <dolinux.peng@gmail.com> - 2017-08-22 15:30 +0200
      Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name  in snd_soc_find_dai Mark Brown <broonie@kernel.org> - 2017-08-22 16:10 +0200
        Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai Donglin Peng <dolinux.peng@gmail.com> - 2017-08-22 16:20 +0200
          Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name  in snd_soc_find_dai Mark Brown <broonie@kernel.org> - 2017-08-22 16:30 +0200
            Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai Takashi Iwai <tiwai@suse.de> - 2017-08-22 16:30 +0200
              Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name  in snd_soc_find_dai Mark Brown <broonie@kernel.org> - 2017-08-22 16:40 +0200
              Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name  in snd_soc_find_dai jeffy <jeffy.chen@rock-chips.com> - 2017-08-22 16:40 +0200

csiph-web