From: Bjorn Andersson <andersson@kernel.org>
To: Mukesh Ojha <quic_mojha@quicinc.com>
Cc: dmitry.baryshkov@linaro.org, agross@kernel.org,
mathieu.poirier@linaro.org, konrad.dybcio@linaro.org,
linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] remoteproc: qcom: replace kstrdup with kstrndup
Date: Tue, 14 Feb 2023 08:39:44 -0800 [thread overview]
Message-ID: <20230214163944.y5tkgdfmsycmpg7p@ripper> (raw)
In-Reply-To: <1676383691-29738-1-git-send-email-quic_mojha@quicinc.com>
On Tue, Feb 14, 2023 at 07:38:11PM +0530, Mukesh Ojha wrote:
> Since, there is no guarantee that region.name will be 0-terminated
> from the firmware side, replace kstrdup with kstrndup.
>
> Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
Please don't send additional patches in-reply-to another patch, it makes
it impossible to use b4 to pick up the first patch.
And please don't send two patches which clearly will conflict with
each other. Now I had to manually apply the first patch...
Regards,
Bjorn
> ---
> drivers/remoteproc/qcom_common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c
> index 020349f..7810f91 100644
> --- a/drivers/remoteproc/qcom_common.c
> +++ b/drivers/remoteproc/qcom_common.c
> @@ -124,7 +124,7 @@ static int qcom_add_minidump_segments(struct rproc *rproc, struct minidump_subsy
> for (i = 0; i < seg_cnt; i++) {
> memcpy_fromio(®ion, ptr + i, sizeof(region));
> if (region.valid == MD_REGION_VALID) {
> - name = kstrdup(region.name, GFP_KERNEL);
> + name = kstrndup(region.name, MAX_REGION_NAME_LENGTH - 1, GFP_KERNEL);
> if (!name) {
> iounmap(ptr);
> return -ENOMEM;
> --
> 2.7.4
>
next prev parent reply other threads:[~2023-02-14 16:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-31 16:01 [PATCH] remoteproc: qcom: fix sparse warnings Mukesh Ojha
2023-02-12 16:11 ` Mukesh Ojha
2023-02-13 0:55 ` Dmitry Baryshkov
2023-02-14 14:12 ` Mukesh Ojha
2023-02-14 14:08 ` [PATCH] remoteproc: qcom: replace kstrdup with kstrndup Mukesh Ojha
2023-02-14 16:39 ` Bjorn Andersson [this message]
2023-02-15 5:16 ` Mukesh Ojha
2023-02-14 17:30 ` Bjorn Andersson
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=20230214163944.y5tkgdfmsycmpg7p@ripper \
--to=andersson@kernel.org \
--cc=agross@kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=quic_mojha@quicinc.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