Re: [PATCH] perf hisi-ptt: Fix memory leak in lseek failure handling

From: Namhyung Kim
Date: Mon Oct 09 2023 - 01:22:09 EST


On Mon, Oct 2, 2023 at 9:48 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>
> Hello,
>
> On Sat, Sep 30, 2023 at 12:27 AM Kuan-Wei Chiu <visitorckw@xxxxxxxxx> wrote:
> >
> > In the previous code, there was a memory leak issue where the previously
> > allocated memory was not freed upon a failed lseek operation. This patch
> > addresses the problem by releasing the old memory before returning -errno
> > in case of a lseek failure. This ensures that memory is properly managed
> > and avoids potential memory leaks.
> >
> > Signed-off-by: Kuan-Wei Chiu <visitorckw@xxxxxxxxx>
>
> Acked-by: Namhyung Kim <namhyung@xxxxxxxxxx>

Applied to perf-tools-next, thanks!