]> Git Repo - linux.git/commit
cxl/cdat: Free correct buffer on checksum error
authorIra Weiny <[email protected]>
Fri, 17 Nov 2023 00:03:29 +0000 (16:03 -0800)
committerDan Williams <[email protected]>
Sat, 9 Dec 2023 00:14:28 +0000 (16:14 -0800)
commitc65efe3685f5d150eeca5599afeabdc85da899d1
tree40c85f66f4d34f5df5da9da39b87a0b630d851bd
parent6f5c4eca48ffe18307b4e1d375817691c9005c87
cxl/cdat: Free correct buffer on checksum error

The new 6.7-rc1 kernel now checks the checksum on CDAT data.  While
using a branch of Fan's DCD qemu work (and specifying DCD devices), the
following splat was observed.

WARNING: CPU: 1 PID: 1384 at drivers/base/devres.c:1064 devm_kfree+0x4f/0x60
...
RIP: 0010:devm_kfree+0x4f/0x60
...
  ? devm_kfree+0x4f/0x60
  read_cdat_data+0x1a0/0x2a0 [cxl_core]
  cxl_port_probe+0xdf/0x200 [cxl_port]
...

The issue in qemu is still unknown but the spat is a straight forward
bug in the CDAT checksum processing code.  Use a CDAT buffer variable to
ensure the devm_free() works correctly on error.

Fixes: 670e4e88f3b1 ("cxl: Add checksum verification to CDAT from CXL")
Signed-off-by: Ira Weiny <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
Reviewed-by: Fan Ni <[email protected]>
Reviewed-by: Robert Richter <[email protected]>
Link: http://lore.kernel.org/r/[email protected]
Signed-off-by: Dan Williams <[email protected]>
drivers/cxl/core/pci.c
This page took 0.054387 seconds and 4 git commands to generate.