From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Patrick Lai <plai@codeaurora.org>
Cc: alsa-devel@alsa-project.org,
Banajit Goswami <bgoswami@codeaurora.org>,
kernel-janitors@vger.kernel.org, Takashi Iwai <tiwai@suse.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Niklas Cassel <niklas.cassel@linaro.org>
Subject: Re: [PATCH] ASoC: qdsp6: q6afe-dai: fix a range check in of_q6afe_parse_dai_data()
Date: Fri, 13 Jul 2018 16:45:32 +0100 [thread overview]
Message-ID: <fc36ef7d-87df-f76b-9641-c354dabc69ca@linaro.org> (raw)
In-Reply-To: <20180713150557.gsx7wrau2l7tg2jq@kili.mountain>
On 13/07/18 16:05, Dan Carpenter wrote:
> The main thing is that the data->priv[] array has AFE_PORT_MAX elements
> so the > condition should be >=. But we may as well check for negative
> values as well just to be safe.
>
> Fixes: 24c4cbcfac09 ("ASoC: qdsp6: q6afe: Add q6afe dai driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks for the patch,
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>
> diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c
> index e7f809e3ee1f..89df25e711c5 100644
> --- a/sound/soc/qcom/qdsp6/q6afe-dai.c
> +++ b/sound/soc/qcom/qdsp6/q6afe-dai.c
> @@ -1329,7 +1329,7 @@ static void of_q6afe_parse_dai_data(struct device *dev,
> int id, i, num_lines;
>
> ret = of_property_read_u32(node, "reg", &id);
> - if (ret || id > AFE_PORT_MAX) {
> + if (ret || id < 0 || id >= AFE_PORT_MAX) {
> dev_err(dev, "valid dai id not found:%d\n", ret);
> continue;
> }
>
prev parent reply other threads:[~2018-07-13 15:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 15:05 [PATCH] ASoC: qdsp6: q6afe-dai: fix a range check in of_q6afe_parse_dai_data() Dan Carpenter
2018-07-13 15:30 ` Applied "ASoC: qdsp6: q6afe-dai: fix a range check in of_q6afe_parse_dai_data()" to the asoc tree Mark Brown
2018-07-13 15:45 ` Srinivas Kandagatla [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=fc36ef7d-87df-f76b-9641-c354dabc69ca@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=alsa-devel@alsa-project.org \
--cc=bgoswami@codeaurora.org \
--cc=broonie@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=niklas.cassel@linaro.org \
--cc=plai@codeaurora.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;
as well as URLs for NNTP newsgroup(s).