Skip to content

Commit

Permalink
fw4: fix reading kernel version
Browse files Browse the repository at this point in the history
Fix reading kernel version for kernels with revision 0 e.g. 6.12
Repair incorrect shift of the revision number causing incorrect value for > 255.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
  • Loading branch information
namiltd committed Nov 20, 2024
1 parent dfbcc1c commit 086a027
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions root/usr/share/ucode/fw4.uc
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,9 @@ return {
v = 0;

if (fd) {
let m = match(fd.read("line"), /^Linux version ([0-9]+)\.([0-9]+)\.([0-9]+)/);
let m = match(fd.read("line"), /^Linux version ([0-9]+)\.([0-9]+)(\.([0-9]+))?/);

v = m ? (+m[1] << 24) | (+m[2] << 16) | (+m[3] << 8) : 0;
v = m ? (+m[1] << 24) | (+m[2] << 16) | (+m[4]) : 0;
fd.close();
}

Expand Down

0 comments on commit 086a027

Please sign in to comment.