[PATCH 0/2] hw/cxl: CDAT file handling fixes.

Jonathan Cameron via posted 2 patches 1 year ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230421132020.7408-1-Jonathan.Cameron@huawei.com
Maintainers: Jonathan Cameron <jonathan.cameron@huawei.com>, Fan Ni <fan.ni@samsung.com>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
hw/cxl/cxl-cdat.c            | 60 +++++++++++++++---------------------
hw/mem/cxl_type3.c           |  4 +++
hw/pci-bridge/cxl_upstream.c |  3 ++
3 files changed, 32 insertions(+), 35 deletions(-)
[PATCH 0/2] hw/cxl: CDAT file handling fixes.
Posted by Jonathan Cameron via 1 year ago
I've picked up Hao Zeng's v5 and added a patch to deal with the
issues that Peter pointed out in this area.

On error, the CDAT file handling left resource dangling and didn't
cleanly exit from calling functions.  Hao Zeng dealt with closing
the file. The second patch deals with the buffer allocation and
ensuring a clean exit at the two callers.

Hao Zeng (1):
  hw/cxl: cdat: Fix open file not closed in ct3_load_cdat()

Jonathan Cameron (1):
  hw/cxl: cdat: Fix failure to free buffer in erorr paths

 hw/cxl/cxl-cdat.c            | 60 +++++++++++++++---------------------
 hw/mem/cxl_type3.c           |  4 +++
 hw/pci-bridge/cxl_upstream.c |  3 ++
 3 files changed, 32 insertions(+), 35 deletions(-)

-- 
2.37.2
Re: [PATCH 0/2] hw/cxl: CDAT file handling fixes.
Posted by Michael Tokarev 12 months ago
21.04.2023 16:20, Jonathan Cameron via wrote:
> I've picked up Hao Zeng's v5 and added a patch to deal with the
> issues that Peter pointed out in this area.
> 
> On error, the CDAT file handling left resource dangling and didn't
> cleanly exit from calling functions.  Hao Zeng dealt with closing
> the file. The second patch deals with the buffer allocation and
> ensuring a clean exit at the two callers.
> 
> Hao Zeng (1):
>    hw/cxl: cdat: Fix open file not closed in ct3_load_cdat()
> 
> Jonathan Cameron (1):
>    hw/cxl: cdat: Fix failure to free buffer in erorr paths
> 
>   hw/cxl/cxl-cdat.c            | 60 +++++++++++++++---------------------
>   hw/mem/cxl_type3.c           |  4 +++
>   hw/pci-bridge/cxl_upstream.c |  3 ++
>   3 files changed, 32 insertions(+), 35 deletions(-)

Hi!

Is it a stable (8.0 & 7.2) material?
The issues does not seem to be very important, still smells like
a good thing to have in -stable.

Thanks,

/mjt
Re: [PATCH 0/2] hw/cxl: CDAT file handling fixes.
Posted by Jonathan Cameron via 12 months ago
On Sat, 20 May 2023 07:46:16 +0300
Michael Tokarev <mjt@tls.msk.ru> wrote:

> 21.04.2023 16:20, Jonathan Cameron via wrote:
> > I've picked up Hao Zeng's v5 and added a patch to deal with the
> > issues that Peter pointed out in this area.
> > 
> > On error, the CDAT file handling left resource dangling and didn't
> > cleanly exit from calling functions.  Hao Zeng dealt with closing
> > the file. The second patch deals with the buffer allocation and
> > ensuring a clean exit at the two callers.
> > 
> > Hao Zeng (1):
> >    hw/cxl: cdat: Fix open file not closed in ct3_load_cdat()
> > 
> > Jonathan Cameron (1):
> >    hw/cxl: cdat: Fix failure to free buffer in erorr paths
> > 
> >   hw/cxl/cxl-cdat.c            | 60 +++++++++++++++---------------------
> >   hw/mem/cxl_type3.c           |  4 +++
> >   hw/pci-bridge/cxl_upstream.c |  3 ++
> >   3 files changed, 32 insertions(+), 35 deletions(-)  
> 
> Hi!
> 
> Is it a stable (8.0 & 7.2) material?
> The issues does not seem to be very important, still smells like
> a good thing to have in -stable.

Issues are leaks only on an error path, so I'd say no for stable.
If others disagree these should be harmless.

Jonathan

> 
> Thanks,
> 
> /mjt
>