From: Cezary Rojewski <cezary.rojewski@intel.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>,
<srinivas.kandagatla@linaro.org>, <bgoswami@codeaurora.org>,
<lgirdwood@gmail.com>, <broonie@kernel.org>, <perex@perex.cz>,
<tiwai@suse.com>
Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ASoC: codecs: lpass-wsa-macro: Check for error pointer after calling devm_regmap_init_mmio
Date: Mon, 10 Jan 2022 17:51:17 +0100 [thread overview]
Message-ID: <516d939c-1c2b-315d-28d3-d55c6c4b6eb3@intel.com> (raw)
In-Reply-To: <20220110064259.4175705-1-jiasheng@iscas.ac.cn>
On 2022-01-10 7:42 AM, Jiasheng Jiang wrote:
> The devm_regmap_init_mmio() may return error pointer in some cases, for
> example the possible failure of the kzalloc() in
> regmap_mmio_gen_context().
> Then the wsa->regmap will be error pointer and be used in
> wsa_macro_mclk_enable().
> Therefore, it should be better to check it in order to avoid the
> dereference of the error pointer.
>
> Fixes: 809bcbcecebf ("ASoC: codecs: lpass-wsa-macro: Add support to WSA Macro")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
> sound/soc/codecs/lpass-wsa-macro.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
> index d3ac318fd6b6..dd1a8b7bc794 100644
> --- a/sound/soc/codecs/lpass-wsa-macro.c
> +++ b/sound/soc/codecs/lpass-wsa-macro.c
> @@ -2405,6 +2405,8 @@ static int wsa_macro_probe(struct platform_device *pdev)
> return PTR_ERR(base);
>
> wsa->regmap = devm_regmap_init_mmio(dev, base, &wsa_regmap_config);
> + if (IS_ERR(wsa->regmap))
> + return PTR_ERR(wsa->regmap);
>
> dev_set_drvdata(dev, wsa);
>
>
Hello,
Perhaps the cover-letter did not yet arrive, however, it would be good
to bundle similar patches together and provide a cover letter for such
series in the future.
I'm replying to the very first patch sent, but it's quite obvious that
lpass-rx and lpass-tx patches are related to this one and it is easier
to get a firm grasp over the changes - from reviewer's point of view -
if all the related ones are part of a single series.
Regards,
Czarek
prev parent reply other threads:[~2022-01-10 16:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 6:42 Jiasheng Jiang
2022-01-10 16:51 ` Cezary Rojewski [this message]
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=516d939c-1c2b-315d-28d3-d55c6c4b6eb3@intel.com \
--to=cezary.rojewski@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=bgoswami@codeaurora.org \
--cc=broonie@kernel.org \
--cc=jiasheng@iscas.ac.cn \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=srinivas.kandagatla@linaro.org \
--cc=tiwai@suse.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
all inboxes | Powered by JetHome®