aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/dvb/get_dvb_firmware
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-07-05 15:22:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-07-05 18:21:49 -0400
commit0a6843483c256c859cd9542361812a29403f0fb5 (patch)
tree910e6cb0b1dda85e11025e01d67673232398008e /Documentation/dvb/get_dvb_firmware
parenta5ca3a1bc719cb9056acc6f24340a1e2674f21a0 (diff)
V4L/DVB (12206): get_dvb_firmware: Correct errors in MPC718 firmware extraction logic
The extraction routine for the MPC718 "firmware" had 2 bugs in it, where one bug masked the effect of the other. The loop iteration should have set $prevlen = $currlen at the end of the loop, and the if() check should have used && instead of || for deciding if the firmware length is reasonable. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/dvb/get_dvb_firmware')
-rw-r--r--Documentation/dvb/get_dvb_firmware3
1 files changed, 2 insertions, 1 deletions
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware
index 64174d6258f0..3d1b0ab70c8e 100644
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -413,13 +413,14 @@ sub mpc718 {
413 413
414 while (<IN>) { 414 while (<IN>) {
415 $currlen = length($_); 415 $currlen = length($_);
416 if ($prevlen == $currlen || $currlen <= 64) { 416 if ($prevlen == $currlen && $currlen <= 64) {
417 chop; chop; # Get rid of "TUNER GO" 417 chop; chop; # Get rid of "TUNER GO"
418 s/^\0\0//; # get rid of leading 00 00 if it's there 418 s/^\0\0//; # get rid of leading 00 00 if it's there
419 printf OUT "$_"; 419 printf OUT "$_";
420 $found = 1; 420 $found = 1;
421 last; 421 last;
422 } 422 }
423 $prevlen = $currlen;
423 } 424 }
424 } 425 }
425 close OUT; 426 close OUT;