summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-01-18 23:31:26 +0000
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-01-18 23:31:26 +0000
commit7987027f994d1a996d966798c87d222c639cb911 (patch)
tree243153b73fd33c9582327d23d05e1d33e49862d7 /linux/drivers
parent6c4ccc0cd8e4160824698caa2bf36b96716a6a04 (diff)
downloadmediapointer-dvb-s2-7987027f994d1a996d966798c87d222c639cb911.tar.gz
mediapointer-dvb-s2-7987027f994d1a996d966798c87d222c639cb911.tar.bz2
DVB: negative internal->sub_range won't get noticed
From: Roel Kluin <roel.kluin@gmail.com> internal->sub_range is unsigned, a negative won't get noticed. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/dvb/frontends/stb0899_algo.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/linux/drivers/media/dvb/frontends/stb0899_algo.c b/linux/drivers/media/dvb/frontends/stb0899_algo.c
index 3d13968a7..71037dc67 100644
--- a/linux/drivers/media/dvb/frontends/stb0899_algo.c
+++ b/linux/drivers/media/dvb/frontends/stb0899_algo.c
@@ -467,13 +467,14 @@ static void next_sub_range(struct stb0899_state *state)
if (internal->sub_dir > 0) {
old_sub_range = internal->sub_range;
- internal->sub_range = MIN((internal->srch_range / 2) -
+ if (internal->tuner_offst + internal->sub_range / 2 >=
+ internal->srch_range / 2)
+ internal->sub_range = 0;
+ else
+ internal->sub_range = MIN((internal->srch_range / 2) -
(internal->tuner_offst + internal->sub_range / 2),
internal->sub_range);
- if (internal->sub_range < 0)
- internal->sub_range = 0;
-
internal->tuner_offst += (old_sub_range + internal->sub_range) / 2;
}