Re: [PATCH] virtio-dmabuf: Ensure UUID persistence for hash table insertion

2024-11-07 Thread Dorinda Bassey
Hi, Since now we allocate memory for the key, we should provide the > `key_destroy_func` when calling g_hash_table_new_full(), otherwise > this new memory will not be de-allocated. > Ack IIUC it can be null, only if `uuid` was null since glib memory > API usually terminates the application if me

Re: [PATCH] virtio-dmabuf: Ensure UUID persistence for hash table insertion

2024-11-07 Thread Stefano Garzarella
On Thu, Nov 07, 2024 at 01:52:01PM +0100, Dorinda Bassey wrote: In `virtio_add_resource` function, the UUID used as a key for `g_hash_table_insert` was temporary, which could lead to invalid lookups when accessed later. This patch ensures that the UUID remains valid by duplicating it into a newly

Re: [PATCH] virtio-dmabuf: Ensure UUID persistence for hash table insertion

2024-11-07 Thread Stefano Garzarella
On Thu, Nov 7, 2024 at 2:43 PM Stefano Garzarella wrote: > > On Thu, Nov 07, 2024 at 01:52:01PM +0100, Dorinda Bassey wrote: > >In `virtio_add_resource` function, the UUID used as a key for > >`g_hash_table_insert` was temporary, which could lead to > >invalid lookups when accessed later. This pat

Re: [PATCH] virtio-dmabuf: Ensure UUID persistence for hash table insertion

2024-11-07 Thread Albert Esteve
On Thu, Nov 7, 2024 at 1:52 PM Dorinda Bassey wrote: > > In `virtio_add_resource` function, the UUID used as a key for > `g_hash_table_insert` was temporary, which could lead to > invalid lookups when accessed later. This patch ensures that > the UUID remains valid by duplicating it into a newly a

[PATCH] virtio-dmabuf: Ensure UUID persistence for hash table insertion

2024-11-07 Thread Dorinda Bassey
In `virtio_add_resource` function, the UUID used as a key for `g_hash_table_insert` was temporary, which could lead to invalid lookups when accessed later. This patch ensures that the UUID remains valid by duplicating it into a newly allocated memory space (persistent_uuid). The value is then inser