From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: trix@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fat: add a check to fat_add_new_entries
Date: Mon, 22 Jun 2020 02:50:44 +0900 [thread overview]
Message-ID: <871rm8b957.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <20200616162922.26168-1-trix@redhat.com> (trix@redhat.com's message of "Tue, 16 Jun 2020 09:29:22 -0700")
trix@redhat.com writes:
> start_blknr = blknr = fat_clus_to_blknr(sbi, cluster[i]);
> last_blknr = start_blknr + sbi->sec_per_clus;
> +
> + /* overflow */
> + if (unlikely(last_blknr <= start_blknr)) {
> + err = -ENOMEM;
> + goto error_nomem;
> + }
> +
The cluster is 28bits and sec_per_clus is 8bits, so this should never
overflow actually. Is there no way to tell it to clang?
Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
prev parent reply other threads:[~2020-06-21 17:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 16:29 [PATCH] fat: add a check to fat_add_new_entries trix
2020-06-21 17:50 ` OGAWA Hirofumi [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=871rm8b957.fsf@mail.parknet.co.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=trix@redhat.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