diff options
author | Robert Richter <[email protected]> | 2024-02-16 16:58:43 +0100 |
---|---|---|
committer | Dan Williams <[email protected]> | 2024-03-12 23:52:29 -0700 |
commit | e0c818e00443ce4a704519d85a21e3c14179e3a6 (patch) | |
tree | e6c92ec123c81c99429be4cda41f08183be3308d /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | ec8ffff3a9f86435996f71299ce729126a7ac8a2 (diff) |
cxl/pci: Get rid of pointer arithmetic reading CDAT table
Reading the CDAT table using DOE requires a Table Access Response
Header in addition to the CDAT entry. In current implementation this
has caused offsets with sizeof(__le32) to the actual buffers. This led
to hardly readable code and even bugs. E.g., see fix of devm_kfree()
in read_cdat_data():
commit c65efe3685f5 ("cxl/cdat: Free correct buffer on checksum error")
Rework code to avoid calculations with sizeof(__le32). Introduce
struct cdat_doe_rsp for this which contains the Table Access Response
Header and a variable payload size for various data structures
afterwards to access the CDAT table and its CDAT Data Structures
without recalculating buffer offsets.
Cc: Lukas Wunner <[email protected]>
Cc: Fan Ni <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
Signed-off-by: Robert Richter <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dan Williams <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions