Re: [PATCH v2 2/2] cxl-cdat:Fix the check on the return value of fread()

2023-04-12 Thread Jonathan Cameron via
On Wed, 12 Apr 2023 12:02:47 +0200 Philippe Mathieu-Daudé wrote: > On 12/4/23 09:16, Hao Zeng wrote: > > The bug in this code (CID 1507822) is that the > > check on the return value of fread() is wrong. fread() > > returns the number of items read or written, so > > checking for == 0 only catches

Re: [PATCH v2 2/2] cxl-cdat:Fix the check on the return value of fread()

2023-04-12 Thread Philippe Mathieu-Daudé
On 12/4/23 09:16, Hao Zeng wrote: The bug in this code (CID 1507822) is that the check on the return value of fread() is wrong. fread() returns the number of items read or written, so checking for == 0 only catches "no data read at all", not "only read half the data". Signed-off-by: Zeng Hao Su

[PATCH v2 2/2] cxl-cdat:Fix the check on the return value of fread()

2023-04-12 Thread Hao Zeng
The bug in this code (CID 1507822) is that the check on the return value of fread() is wrong. fread() returns the number of items read or written, so checking for == 0 only catches "no data read at all", not "only read half the data". Signed-off-by: Zeng Hao Suggested-by: Peter Maydell --- hw/c