* [PATCH] cryptodev: fix memory leak during stats query
@ 2023-05-03 11:54 zhenwei pi
2023-05-03 12:59 ` Peter Maydell
0 siblings, 1 reply; 4+ messages in thread
From: zhenwei pi @ 2023-05-03 11:54 UTC (permalink / raw)
To: mst, arei.gonglei; +Cc: qemu-devel, zhenwei pi, Peter Maydell
object_get_canonical_path already returns newly allocated memory, this
means no additional g_strdup required. Remove g_strdup to avoid memory
leak.
Fixes: Coverity CID 1508074
Fixes: f2b901098 ("cryptodev: Support query-stats QMP command")
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
---
backends/cryptodev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backends/cryptodev.c b/backends/cryptodev.c
index 94ca393cee..7d29517843 100644
--- a/backends/cryptodev.c
+++ b/backends/cryptodev.c
@@ -522,7 +522,7 @@ static int cryptodev_backend_stats_query(Object *obj, void *data)
entry = g_new0(StatsResult, 1);
entry->provider = STATS_PROVIDER_CRYPTODEV;
- entry->qom_path = g_strdup(object_get_canonical_path(obj));
+ entry->qom_path = object_get_canonical_path(obj);
entry->stats = stats_list;
QAPI_LIST_PREPEND(*stats_results, entry);
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] cryptodev: fix memory leak during stats query
2023-05-03 11:54 [PATCH] cryptodev: fix memory leak during stats query zhenwei pi
@ 2023-05-03 12:59 ` Peter Maydell
2023-05-26 8:34 ` zhenwei pi
0 siblings, 1 reply; 4+ messages in thread
From: Peter Maydell @ 2023-05-03 12:59 UTC (permalink / raw)
To: zhenwei pi; +Cc: mst, arei.gonglei, qemu-devel
On Wed, 3 May 2023 at 12:54, zhenwei pi <pizhenwei@bytedance.com> wrote:
>
> object_get_canonical_path already returns newly allocated memory, this
> means no additional g_strdup required. Remove g_strdup to avoid memory
> leak.
>
> Fixes: Coverity CID 1508074
> Fixes: f2b901098 ("cryptodev: Support query-stats QMP command")
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
> ---
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Re: [PATCH] cryptodev: fix memory leak during stats query
2023-05-03 12:59 ` Peter Maydell
@ 2023-05-26 8:34 ` zhenwei pi
2023-05-28 11:29 ` Michael S. Tsirkin
0 siblings, 1 reply; 4+ messages in thread
From: zhenwei pi @ 2023-05-26 8:34 UTC (permalink / raw)
To: mst; +Cc: Peter Maydell, arei.gonglei, qemu-devel
On 5/3/23 20:59, Peter Maydell wrote:
> On Wed, 3 May 2023 at 12:54, zhenwei pi <pizhenwei@bytedance.com> wrote:
>>
>> object_get_canonical_path already returns newly allocated memory, this
>> means no additional g_strdup required. Remove g_strdup to avoid memory
>> leak.
>>
>> Fixes: Coverity CID 1508074
>> Fixes: f2b901098 ("cryptodev: Support query-stats QMP command")
>> Cc: Peter Maydell <peter.maydell@linaro.org>
>> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
>> ---
>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
>
> thanks
> -- PMM
Hi, Michael
This patch has been ignored, could you please merge this in next PR?
--
zhenwei pi
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Re: [PATCH] cryptodev: fix memory leak during stats query
2023-05-26 8:34 ` zhenwei pi
@ 2023-05-28 11:29 ` Michael S. Tsirkin
0 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2023-05-28 11:29 UTC (permalink / raw)
To: zhenwei pi; +Cc: Peter Maydell, arei.gonglei, qemu-devel
On Fri, May 26, 2023 at 04:34:21PM +0800, zhenwei pi wrote:
>
>
> On 5/3/23 20:59, Peter Maydell wrote:
> > On Wed, 3 May 2023 at 12:54, zhenwei pi <pizhenwei@bytedance.com> wrote:
> > >
> > > object_get_canonical_path already returns newly allocated memory, this
> > > means no additional g_strdup required. Remove g_strdup to avoid memory
> > > leak.
> > >
> > > Fixes: Coverity CID 1508074
> > > Fixes: f2b901098 ("cryptodev: Support query-stats QMP command")
> > > Cc: Peter Maydell <peter.maydell@linaro.org>
> > > Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
> > > ---
> >
> > Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> >
> > thanks
> > -- PMM
>
> Hi, Michael
>
> This patch has been ignored, could you please merge this in next PR?
>
> --
> zhenwei pi
>
I don't know why - didn't have it in my inbox. Tagged now, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-05-28 11:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-03 11:54 [PATCH] cryptodev: fix memory leak during stats query zhenwei pi
2023-05-03 12:59 ` Peter Maydell
2023-05-26 8:34 ` zhenwei pi
2023-05-28 11:29 ` Michael S. Tsirkin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.