From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: [PATCH 2/8] dvb-frontends: ves1820: fix potential integer overflow
Date: Mon, 29 Jan 2018 18:31:20 -0600 [thread overview]
Message-ID: <2bc8d41c5ef755fbbe3f3e06c427928b97ed4731.1517268667.git.gustavo@embeddedor.com> (raw)
In-Reply-To: <cover.1517268667.git.gustavo@embeddedor.com>
Cast state->config->xin to u64 in order to avoid a potential integer
overflow. This variable is being used in a context that expects an
expression of type u64.
Addresses-Coverity-ID: 200604 ("Unintentional integer overflow")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/media/dvb-frontends/ves1820.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/dvb-frontends/ves1820.c b/drivers/media/dvb-frontends/ves1820.c
index 1d89792..9dbd582 100644
--- a/drivers/media/dvb-frontends/ves1820.c
+++ b/drivers/media/dvb-frontends/ves1820.c
@@ -137,7 +137,7 @@ static int ves1820_set_symbolrate(struct ves1820_state *state, u32 symbolrate)
NDEC = 3;
/* yeuch! */
- fpxin = state->config->xin * 10;
+ fpxin = (u64)state->config->xin * 10;
fptmp = fpxin; do_div(fptmp, 123);
if (symbolrate < fptmp)
SFIL = 1;
--
2.7.4
next prev parent reply other threads:[~2018-01-30 0:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 1:07 [PATCH resend 0/8] fix potential integer overflows Gustavo A. R. Silva
2018-01-30 0:30 ` [PATCH 1/8] rtl2832: fix potential integer overflow in rtl2832_set_frontend Gustavo A. R. Silva
2018-01-30 0:31 ` Gustavo A. R. Silva [this message]
2018-01-30 0:31 ` [PATCH 3/8] i2c: max2175: fix potential integer overflow in max2175_set_nco_freq Gustavo A. R. Silva
2018-01-30 0:32 ` [PATCH 4/8] i2c: ov9650: fix potential integer overflow in __ov965x_set_frame_interval Gustavo A. R. Silva
2018-02-02 9:22 ` Sakari Ailus
2018-01-30 0:32 ` [PATCH 5/8] pci: cx88-input: fix potential integer overflow Gustavo A. R. Silva
2018-01-30 0:32 ` [PATCH 6/8] rockchip/rga: fix potential integer overflow in rga_buf_map Gustavo A. R. Silva
2018-01-30 0:33 ` [PATCH 7/8] platform: sh_veu: fix potential integer overflow in sh_veu_colour_offset Gustavo A. R. Silva
2018-01-30 0:33 ` [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events Gustavo A. R. Silva
2018-01-30 7:21 ` Hans Verkuil
2018-01-30 8:51 ` Gustavo A. R. Silva
2018-01-30 9:57 ` Hans Verkuil
2018-01-30 10:55 ` Gustavo A. R. Silva
2018-01-30 11:15 ` Hans Verkuil
2018-01-30 11:43 ` Gustavo A. R. Silva
2018-01-30 11:50 ` Hans Verkuil
2018-01-30 11:57 ` Gustavo A. R. Silva
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=2bc8d41c5ef755fbbe3f3e06c427928b97ed4731.1517268667.git.gustavo@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=garsilva@embeddedor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@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
all inboxes | Powered by JetHome®