From: Dan Carpenter <dan.carpenter@oracle.com>
To: bjorn.andersson@linaro.org
Cc: linux-arm-msm@vger.kernel.org
Subject: Re: [bug report] remoteproc: qcom: mdt_loader: Refactor MDT loader
Date: Tue, 14 Feb 2017 11:27:00 +0300 [thread overview]
Message-ID: <20170214082700.GG4162@mwanda> (raw)
In-Reply-To: <20170214082614.GA7261@mwanda>
Also:
drivers/remoteproc/qcom_q6v5_pil.c:552 q6v5_mpss_load()
warn: unsigned 'offset' is never less than zero.
regards,
dan carpenter
On Tue, Feb 14, 2017 at 11:26:14AM +0300, Dan Carpenter wrote:
> Hello Bjorn Andersson,
>
> The patch 7f0dd07a9b29: "remoteproc: qcom: mdt_loader: Refactor MDT
> loader" from Jan 27, 2017, leads to the following static checker
> warning:
>
> drivers/soc/qcom/mdt_loader.c:171 qcom_mdt_load()
> warn: unsigned 'offset' is never less than zero.
>
> drivers/soc/qcom/mdt_loader.c
> 164 for (i = 0; i < ehdr->e_phnum; i++) {
> 165 phdr = &phdrs[i];
> 166
> 167 if (!mdt_phdr_valid(phdr))
> 168 continue;
> 169
> 170 offset = phdr->p_paddr - mem_reloc;
> 171 if (offset < 0 || offset + phdr->p_memsz > mem_size) {
> ^^^^^^^^^^
> offset is size_t.
>
> 172 dev_err(dev, "segment outside memory range\n");
> 173 ret = -EINVAL;
> 174 break;
> 175 }
> 176
>
> regards,
> dan carpenter
prev parent reply other threads:[~2017-02-14 8:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-14 8:26 [bug report] remoteproc: qcom: mdt_loader: Refactor MDT loader Dan Carpenter
2017-02-14 8:27 ` Dan Carpenter [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=20170214082700.GG4162@mwanda \
--to=dan.carpenter@oracle.com \
--cc=bjorn.andersson@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
/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