aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/lpddr/lpddr_cmds.c
diff options
context:
space:
mode:
authorVasily Khoruzhick <anarsoul@gmail.com>2023-09-27 12:50:02 -0700
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-10-03 21:12:22 +0200
commita83c68a3bf7c418c9a46693c63c638852b0c1f4e (patch)
tree4cafbe2f77cf186530de2199df04db87681bbab9 /drivers/mtd/lpddr/lpddr_cmds.c
parent8a749fd1a8720d4619c91c8b6e7528c0a355c0aa (diff)
ACPI: FPDT: properly handle invalid FPDT subtables
Buggy BIOSes may have invalid FPDT subtables, e.g. on my hardware: S3PT subtable: 7F20FE30: 53 33 50 54 24 00 00 00-00 00 00 00 00 00 18 01 *S3PT$...........* 7F20FE40: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 *................* 7F20FE50: 00 00 00 00 Here the first record has zero length. FBPT subtable: 7F20FE50: 46 42 50 54-3C 00 00 00 46 42 50 54 *....FBPT<...FBPT* 7F20FE60: 02 00 30 02 00 00 00 00-00 00 00 00 00 00 00 00 *..0.............* 7F20FE70: 2A A6 BC 6E 0B 00 00 00-1A 44 41 70 0B 00 00 00 **..n.....DAp....* 7F20FE80: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 *................* And here FBPT table has FBPT signature repeated instead of the first record. Current code will be looping indefinitely due to zero length records, so break out of the loop if record length is zero. While we are here, add proper handling for fpdt_process_subtable() failures. Fixes: d1eb86e59be0 ("ACPI: tables: introduce support for FPDT table") Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> [ rjw: Comment edit, added empty code lines ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/mtd/lpddr/lpddr_cmds.c')
0 files changed, 0 insertions, 0 deletions