Add a return to the error path when cxl_cdat_read_table() fails. Current code continues with the table pointer points to freed memory.
Unified · Split
| @@ -571,6 +571,7 @@ void read_cdat_data(struct cxl_port *port) · 570 unmodified lines | ||
| 571 | 571 | /* Don't leave table data allocated on error */ |
| 572 | 572 | devm_kfree(dev, cdat_table); |
| 573 | 573 | dev_err(dev, "CDAT data read error\n"); |
| 574 | + return; | |
| 574 | 575 | } |
| 575 | 576 | |
| 576 | 577 | port->cdat.table = cdat_table + sizeof(__le32); |