Skip to content

Commit

Permalink
V4L/DVB (12206): get_dvb_firmware: Correct errors in MPC718 firmware …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Andy Walls authored and Mauro Carvalho Chehab committed Jul 5, 2009
1 parent a5ca3a1 commit 0a68434
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Documentation/dvb/get_dvb_firmware
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,14 @@ sub mpc718 {

while (<IN>) {
$currlen = length($_);
if ($prevlen == $currlen || $currlen <= 64) {
if ($prevlen == $currlen && $currlen <= 64) {
chop; chop; # Get rid of "TUNER GO"
s/^\0\0//; # get rid of leading 00 00 if it's there
printf OUT "$_";
$found = 1;
last;
}
$prevlen = $currlen;
}
}
close OUT;
Expand Down

0 comments on commit 0a68434

Please sign in to comment.