From: Markus Elfring <Markus.Elfring@web.de>
To: Chenyuan Yang <chenyuan0y@gmail.com>, linux-sound@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Chao Song <chao.song@linux.intel.com>,
Jaroslav Kysela <perex@perex.cz>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
Takashi Iwai <tiwai@suse.com>,
Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Subject: Re: [PATCH] ASoC: Intel: sof_sdw: Add NULL check in asoc_sdw_rt_dmic_rtd_init()
Date: Wed, 16 Apr 2025 09:19:12 +0200 [thread overview]
Message-ID: <e1890bbe-183c-43ee-b866-936f9a7e4801@web.de> (raw)
In-Reply-To: <20250415194134.292830-1-chenyuan0y@gmail.com>
> mic_name returned by devm_kasprintf() could be NULL.
> Add a check for it.
Was this patch also supported by the source code analysis tool “KNighter”?
…
> +++ b/sound/soc/sdw_utils/soc_sdw_rt_dmic.c
> @@ -29,6 +29,8 @@ int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_da
> mic_name = devm_kasprintf(card->dev, GFP_KERNEL, "rt715-sdca");
> else
> mic_name = devm_kasprintf(card->dev, GFP_KERNEL, "%s", component->name_prefix);
…
How do you think about to use the function “devm_kstrdup” in one if branch instead
(by another update step)?
https://elixir.bootlin.com/linux/v6.14-rc6/source/drivers/base/devres.c#L958-L965
Regards,
Markus
next prev parent reply other threads:[~2025-04-16 7:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-15 19:41 [PATCH] ASoC: Intel: sof_sdw: Add NULL check in asoc_sdw_rt_dmic_rtd_init() Chenyuan Yang
2025-04-16 7:19 ` Markus Elfring [this message]
2025-04-16 11:19 ` Mark Brown
2025-04-16 14:23 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e1890bbe-183c-43ee-b866-936f9a7e4801@web.de \
--to=markus.elfring@web.de \
--cc=Vijendar.Mukunda@amd.com \
--cc=broonie@kernel.org \
--cc=chao.song@linux.intel.com \
--cc=chenyuan0y@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=peterz@infradead.org \
--cc=pierre-louis.bossart@linux.dev \
--cc=tiwai@suse.com \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox