Skip to content

Commit 764d102

Browse files
davejiangdjbw
authored andcommitted
cxl: Add missing return to cdat read error path
Add a return to the error path when cxl_cdat_read_table() fails. Current code continues with the table pointer points to freed memory. Fixes: 7a877c9 ("cxl/pci: Simplify CDAT retrieval error path") Signed-off-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net> Link: https://lore.kernel.org/r/168382793506.3510737.4792518576623749076.stgit@djiang5-mobl3 Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 270205b commit 764d102

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/cxl/core/pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ void read_cdat_data(struct cxl_port *port)
571571
/* Don't leave table data allocated on error */
572572
devm_kfree(dev, cdat_table);
573573
dev_err(dev, "CDAT data read error\n");
574+
return;
574575
}
575576

576577
port->cdat.table = cdat_table + sizeof(__le32);

0 commit comments

Comments
 (0)