linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] r820t: fix size and init values
@ 2014-03-16 21:41 Benjamin Larsson
  0 siblings, 0 replies; only message in thread
From: Benjamin Larsson @ 2014-03-16 21:41 UTC (permalink / raw)
  To: linux-media

Correct the initialization values at the start of the function
and use proper variable sizes to prevent overflow.

Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
---
 drivers/media/tuners/r820t.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
index d9ee43f..ce10c18 100644
--- a/drivers/media/tuners/r820t.c
+++ b/drivers/media/tuners/r820t.c
@@ -1468,7 +1468,8 @@ static int r820t_imr_prepare(struct r820t_priv *priv)
 static int r820t_multi_read(struct r820t_priv *priv)
 {
 	int rc, i;
-	u8 data[2], min = 0, max = 255, sum = 0;
+	u16 sum = 0;
+	u8 data[2], min = 255, max = 0;
 
 	usleep_range(5000, 6000);
 
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-03-16 21:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-16 21:41 [PATCH] r820t: fix size and init values Benjamin Larsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).