From: coverity-bot <keescook@chromium.org>
To: Jyri Sarha <jsarha@ti.com>
Cc: Benoit Parrot <bparrot@ti.com>, Sam Ravnborg <sam@ravnborg.org>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
linux-next@vger.kernel.org
Subject: Coverity: dispc_vp_mode_valid(): Integer handling issues
Date: Mon, 13 Apr 2020 09:15:24 -0700 [thread overview]
Message-ID: <202004130915.6EE0CBB6@keescook> (raw)
Hello!
This is an experimental automated report about issues detected by Coverity
from a scan of next-20200413 as part of the linux-next weekly scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan
You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:
Fri Nov 8 09:45:28 2019 +0200
32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem")
Coverity reported the following:
*** CID 1461667: Integer handling issues (OVERFLOW_BEFORE_WIDEN)
/drivers/gpu/drm/tidss/tidss_dispc.c: 1175 in dispc_vp_mode_valid()
1169 return MODE_BAD_VVALUE;
1170
1171 if (dispc->memory_bandwidth_limit) {
1172 const unsigned int bpp = 4;
1173 u64 bandwidth;
1174
vvv CID 1461667: Integer handling issues (OVERFLOW_BEFORE_WIDEN)
vvv Potentially overflowing expression "1000 * mode->clock" with type "int" (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "u64" (64 bits, unsigned).
1175 bandwidth = 1000 * mode->clock;
1176 bandwidth = bandwidth * mode->hdisplay * mode->vdisplay * bpp;
1177 bandwidth = div_u64(bandwidth, mode->htotal * mode->vtotal);
1178
1179 if (dispc->memory_bandwidth_limit < bandwidth)
1180 return MODE_BAD;
If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):
Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1461667 ("Integer handling issues")
Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem")
Thanks for your attention!
--
Coverity-bot
reply other threads:[~2020-04-13 16:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202004130915.6EE0CBB6@keescook \
--to=keescook@chromium.org \
--cc=bparrot@ti.com \
--cc=gustavo@embeddedor.com \
--cc=jsarha@ti.com \
--cc=linux-next@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=tomi.valkeinen@ti.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